function datasheet(){

    window.location.href="/sfsapp/eng/datasheetinter/index.jsp";

}



//old search function

function fastsearch(){

    var searchStr = document.forms[0].withinQuery_2.value;

    window.location.href="/gep/Plastics/global/jsp/search/sitesearch.jsp?withinQuery_2="+searchStr+"&srhOpt=wholeSite&search=search";

}



//refined search added--girish

function refinedSearch()  {  	  		

  var srhOpt="";

	if(document.searchResultsForm.withinQuery_2.value!=null){	  

	document.searchResultsForm.withinQuery_2.value=document.searchResultsForm.withinQuery_2.value.replace(/^\s+/, "");

  document.searchResultsForm.withinQuery_2.value=document.searchResultsForm.withinQuery_2.value.replace(/\"/g,"");

	}			  	

	document.searchResultsForm.withinQuery_2.value = encodeURIComponentNew(document.searchResultsForm.withinQuery_2.value);	                                                  	

  document.searchResultsForm.action="/gepapp/Plastics/global/jsp/search/sitesearch.jsp";

	document.searchResultsForm.submit();  

}

  

var okURIchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_ \"-";

function encodeURIComponentNew(s) {  

	if(s==null || s.length<=0)  	

		return s;  

	var s = utf8(s);  

	var c;  

	var enc = "";  

	for (var i= 0; i<s.length; i++) {    

		if (okURIchars.indexOf(s.charAt(i))==-1)     

			 enc += "%"+toHex(s.charCodeAt(i));    

		else      

			enc += s.charAt(i);  

	}  

	return enc;

}



var hexchars = "0123456789ABCDEF";

function toHex(n){  

  return hexchars.charAt(n>>4)+hexchars.charAt(n & 0xF);

}



function utf8(wide) {  

	var c, s;  

	var enc = "";  

	var i = 0;  

	while(i<wide.length) {    

		c= wide.charCodeAt(i++);        

		if (c>=0xDC00 && c<0xE000) 

			continue;    

		if (c>=0xD800 && c<0xDC00) {      

			if (i>=wide.length) continue;      

				s= wide.charCodeAt(i++);      

				if (s<0xDC00 || c>=0xDE00) 

					continue;      

				c= ((c-0xD800)<<10)+(s-0xDC00)+0x10000;    

		}       

		 if (c<0x80) 

			enc += String.fromCharCode(c);    

		else if (c<0x800) 

			enc += String.fromCharCode(0xC0+(c>>6),0x80+(c&0x3F));    

		else if (c<0x10000) 

			enc += String.fromCharCode(0xE0+(c>>12),0x80+(c>>6&0x3F),0x80+(c&0x3F));    

		else 

			enc += String.fromCharCode(0xF0+(c>>18),0x80+(c>>12&0x3F),0x80+(c>>6&0x3F),0x80+(c&0x3F));  

	}  

	return enc;

}



function selectLanguage(){

    var opt=document.language.lanOpt;

    var url = opt.options[opt.selectedIndex].value;

    if(opt.selectedIndex == 1){

     window.location.href=url;

   }	

   else{

    window.open(url,null, "height=800,width=600,status=yes,toolbar=yes,resizable=yes,scrollbars=yes,titlebar=yes,location=yes,menubar=yes");

     }

}



function aboutus (){

    window.location.href="/gep/pt/AboutUs/AboutUs/about_us.html";

}

function contactus(){

    window.location.href="/gep/Plastics/pt/UtilityPages/ContactUs/contact_us_specialtyfilmsheet.html";

}

function home(){

    window.location.href="/gep/pt/Home/Home/home.html";

}

function sfsHome(){

    window.location.href="/sfs/SFS/en/HomePage/Home/home.html";

} 

function careers(){

    window.location.href="http://jobs.brassring.com/1033/ASP/TG/cim_home.asp?partnerid=25094&siteid=5086";

}

function newsRoom(){

    window.location.href="/gep/pt/NewsRoom/NewsRoom/news_room.html";

}



function submitonenter(myfield,e)  {    

	var keycode;    

	if (window.event)        

		keycode = window.event.keyCode;    

	else if (e)        

		keycode = e.which;    

	else        

		return true;    

  if (keycode == 13)    {       

		fastsearch();       

		return false;    

	}   

	else    {       

		return true;    

	} 

}    



var submenu=new Array();

function languageList(){

submenu[0]="<a target='_new' href='/sfs/SFS/en/HomePage/Home/home.html'>Japanese</a>"; }


