setTimeout("changePage()", 3000);

function changePage(){
    if (self.parent.frames.length != 0)
        self.parent.location=document.location;
}

function getCookieVal(offset){
	var endstr = document.cookie.indexOf(";",offset);
	if(endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset,endstr));
}

function GetCookie(name){
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while(i < clen){
		var j = i + alen;
		if(document.cookie.substring(i,j) == arg)
			return getCookieVal(j);
		i = document.cookie.indexOf(" ",i) + 1;
		if(i == 0)
			break;
	}
	return null;
}
 
function setCookie(region){
	var regionCookie;
	var gonext;
	var count = 50;
							
	switch(region){
		case 'AMR':
			regionCookie = 'AMR';
			break;
		case 'EUR':
			regionCookie = 'EUR';
			break;
		case 'ASI':
			regionCookie = 'ASI';
			break;
		case 'LAM':
			regionCookie = 'LAM';
			break;
		default:
			regionCookie = 'AMR';
			break;
	}
	
	//alert("region = '" + region + "'");
	
	document.cookie = 'reg=' + regionCookie + '; expires=Sat, 1-Jan-2030 00:00:00 GMT;path=/;';
	
	//alert("reg = '" + GetCookie('reg') + "'");
}

function Complete(varRG){
		document.frmPUA.action = '/PurAdditives/product_offering.asp';
		document.frmPUA.intProductTypeCategoryId.value = 5;
		document.frmPUA.intRegionalMarketSegment.value = varRG;
		document.frmPUA.submit();
	}

function PRODselect(varRMS){
  if (varRMS==0){
		document.frmPUA.intProductTypeCategoryId.value = 34;
  }
  else {
	  document.frmPUA.intProductTypeCategoryId.value = 34;
	}
	//if(varRMS < 55 || varRMS > 59)
	//	document.frmPUA.action = "/PurAdditives/product_offering.asp";
	//else
		document.frmPUA.action = "/PurAdditives/rms.asp";
	document.frmPUA.intRegionalMarketSegment.value = varRMS;
	//document.frmPUA.intProductTypeCategoryId.value = varPTC;
	document.frmPUA.submit();
}

function RMSselect(varRMS){	
	if (varRMS==0){
		document.frmPUA.action = "/PurAdditives/product_offering.asp";
		document.frmPUA.intProductTypeCategoryId.value = 34;
    }
    else {
		document.frmPUA.action = "/PurAdditives/rms.asp";
	}
		document.frmPUA.intRegionalMarketSegment.value = varRMS;
		//document.frmPUA.intProductTypeCategoryId.value = varPTC;
		document.frmPUA.submit();
}

function Appselect(varRMS){
	document.frmPUA.action = "/PurAdditives/controlled/app_study.asp"
    document.frmPUA.intRegionalMarketSegment.value = varRMS;
    document.frmPUA.intProductTypeCategoryId.value = 34;
    document.frmPUA.submit();
}

function Specselect(varRMS){
	document.frmPUA.action = "/PurAdditives/controlled/product_specifier.asp";
	document.frmPUA.intApplicationGroup.value = 0;
    document.frmPUA.intRegionalMarketSegment.value = varRMS;
    //document.frmPUA.intProductTypeCategoryId.value = varPTC;
    document.frmPUA.submit();
}

function Specifier(varAG, varSubTab, varRecommend) {
    document.frmPUA.intApplicationGroup.value = varAG;
    document.frmPUA.intSubTab.value = varSubTab;
    document.frmPUA.intApplicationId.value = varSubTab;
	document.frmPUA.intRecommend.value = varRecommend;
    document.frmPUA.submit()
}

function SelectProd(varPC, varReg){
	document.frmPUA.action = '/PurAdditives/controlled/product_description.asp';
	document.frmPUA.pc.value = varPC;
	document.frmPUA.intRegionalMarketSegment.value = varReg;
	document.frmPUA.submit();
}

function GoMenu(){
	document.frmPUA.action = '/PurAdditives/rms.asp';
	document.frmPUA.submit();
}

function GoMenu2(varRMS){
	document.frmPUA.action = '/PurAdditives/product_offering.asp';
	document.frmPUA.submit();
}
function GoMenu3(varRMS){
	document.frmPUA.action = '/PurAdditives/controlled/product_specifier.asp';
	document.frmPUA.submit();
}
function SetTab(varTab){
	document.frmPUA.intTab.value = varTab;
	document.frmPUA.intProductTypeCategoryId.value = varTab;
	document.frmPUA.action = '/PurAdditives/product_offering.asp';
	document.frmPUA.submit();
}
function MSDSList(varSearch, msdslink){
	document.frmPUA.msdslang.value = '1033';
	document.frmPUA.type.value = 'Gas';
	document.frmPUA.search.value = varSearch;
	document.frmPUA.action = msdslink;
	document.frmPUA.submit();
}