
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function disable(title) 
{
var i, a, main;
main = title.charAt(0) + title.charAt(1);
for(i=0; (a = document.getElementsByTagName("link")
[i]);i++) 
{
if (a.getAttribute("title").indexOf(main) != -1) 
{
a.disabled = true;
}
}
}


function setActiveStyleSheet(title, reset, option) 
{
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]);i++) 
{
//alert(a.title);
if (a.getAttribute("title").indexOf(title) != -1) 
{
a.disabled = false;
}
}

if (reset == 1) 
{
createCookie("wstyle", 365, option);
}
}


function setStyle() 
{
if (document.cookie.indexOf("wstyle") != -1)
{
			 str_tmp = document.cookie.substring(7,document.cookie.length-1);
			 ca = str_tmp.split(":");
			 tam = ca.length; 
			 
			 if (ca[0] != null && ca[0] != '' ) 
			 {
 	 		 		for (i=0;i<tam;i++)
	 				{
       		 		disable(ca[i]);
			 				str = ca[i].substring(0,ca[i].length-2);
			 				setActiveStyleSheet(ca[i],0,str);
	 				}
			}
}
}


function createCookie(name,days,opt) 
{
    value = "";
    tam = 0;
		if (days)
    {
     var date = new Date();
     date.setTime(date.getTime()+
(days*24*60*60*1000));
     var expires = ";expires="+date.toGMTString();
    }
    else expires = "";
  
		if (document.cookie.indexOf("wstyle") != -1)
			 {
			 str_tmp = document.cookie.substring(7,document.cookie.length-1);
			 vt = str_tmp.split(":");
			 tam = vt.length; 
			 }
		
		for(i=0; (a = document.getElementsByTagName("link")[i]);i++) 
		{
		 if (a.title != 'basic')
		 {
		 	if (a.title.indexOf(opt) != -1 && a.disabled == false) 
		 	{
					if (tam > 0)
					{
		 	 		 	 got = false;
						 for (x=0;x<tam;x++)
			 			 {	 
			 		 	 		 if (vt[x].charAt(0) == a.title.charAt(0)) 
								 {
								 	vt[x] = a.title;
								  got = true;
									}
						 }
						 if (!got)		value = a.title + ":";
					}
					else value = a.title + ":";
			}
		 }
		}
		if (tam > 0)
		{
		 	 for (x=0;x<tam;x++)
			 {	 
			 		 value = value + vt[x] + ":";
	  	 }
		}
		
		document.cookie = name + "=" + value + "; expires=" + expires;
}


pcountry = "us";
