document.write("<script type=\"text/javascript\" src=\"http://www.google.com/jsapi?key=ABQIAAAAStTJ73QWEGb_WG0FBUJxhRQ0mxjROmXlohMqNtwUTUG98dpwCxRDgtUZPSPoJelf1E8zQFIM-CspWg\"></script>");
document.write("<script src=\"http://www.google.com/jsapi\"></script>");
function open_popup(_1,_2,_3,_4){
prefs="resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no,width="+_3+",height="+_4;
thWin=window.open(_1,_2,prefs);
thWin.focus();
};
function open_popup_scroll(_5,_6,_7,_8){
prefs="resizable=no,scrollbars=yes,scrolling=1,menubar=no,toolbar=no,directories=no,location=no,status=no,width="+_7+",height="+_8;
thWin=window.open(_5,_6,prefs);
thWin.focus();
};
function changeLanguage(_9){
cookieName="SibLang";
chLang="";
if(_9=="en"){
window.location="../../en_UK/main/index_en.html";
}else{
if(_9=="es"){
window.location="../../es_ES/main/index_es.html";
}else{
if(_9=="fr"){
window.location="../../fr_FR/main/index_fr.html";
}else{
if(_9=="it"){
window.location="../../it_IT/main/index_it.html";
}else{
if(_9=="de"){
window.location="../../de_DE/main/index_de.html";
}
}
}
}
}
};
var chosLang="en_UK";
function openGlossary(_a){
filename="../../cgi-bin/en_UK/popup_glossary_en.pl?search="+_a;
glossary=window.open(filename,"glossary","toolbar=no,resize=yes,status=no,scrollbars=yes,personalbar=no,menubar=no,width=330,height=196");
};
function open_pic(_b,_c,_d,_e){
prefs="resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no,width="+_d+",height="+_e;
thWin=window.open(_b,_c,prefs);
thWin.focus();
};
function open_pic_scroll(_f,_10,_11,_12){
prefs="resizable=no,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no,width="+_11+",height="+_12;
thWin=window.open(_f,_10,prefs);
thWin.focus();
};
function open_hygienetips(_13){
path=_13;
name="hygiene";
width=560;
height=400;
prefs="resizable=no,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no,width="+width+",height="+height;
thWin=window.open(path,name,prefs);
};
function opennofrenchpopup(){
path="../main/nofrench.html";
name="nofrench";
width=300;
height=250;
prefs="resizable=no,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no,width="+width+",height="+height;
thWin=window.open(path,name,prefs);
};
function openWhatIs(){
filename="../../en_UK/main/popup_whatisit.html";
glossary=window.open(filename,"glossary","toolbar=no,resize=yes,status=no,scrollbars=no,personalbar=no,menubar=no,width=420,height=260");
};
function openFilesafeAni(){
filename="../../en_UK/main/popup_filesafe.html";
glossary=window.open(filename,"illustrate","toolbar=no,resize=yes,status=no,scrollbars=no,personalbar=no,menubar=no,width=330,height=196");
};
function popUpWindow(_14,w,h){
ref=window.open(_14,"popupwindow","status=no,scrollbars=no,scrolling=0,resizable=no,width="+w+",height="+h+",top=10,left=10,locationbar=no");
};
function popUpScrollWindow(_17,w,h){
ref=window.open(_17,"popupwindow","status=no,scrollbars=yes,scrolling=1,resizable=no,width="+w+",height="+h+",top=10,left=10,locationbar=no");
};
function bookIt(_1a){
var _1b=new Array();
_1b=_1a.split("|");
if(document.all){
window.external.AddFavorite(_1b[0],_1b[1]);
}else{
alert("Sorry. Netscape users must bookmark the pages manually by hitting <Ctrl-D>");
}
};
function interestChange(){
param=document.forms[interestFormName].topic.value;
if(param=="ScientificPublications"){
redir="../../cgi-bin/en_UK/scientificpublications_en.pl";
}
if(param=="ProductSafetyData"){
redir="../../en_UK/product/productcompsitions_en.html";
}
if(param=="EnvironmentalMonitoring"){
redir="../../en_UK/safety/envmodelling_en.html";
}
if(param=="SafetyAssessment"){
redir="../../en_UK/safety/riskassessment_en.html";
}
if(param=="Animations"){
redir="../../en_UK/main/multimedia_en.html";
}
if(param=="ConsumerResearch"){
redir="../../en_UK/research/consumerresearch_en.html";
}
if(param=="ProductDevelopment"){
redir="../../en_UK/research/product_development_en.html";
}
if(param=="FateProcesses"){
redir="../../en_UK/safety/fateprocess_en.html";
}
document.location.href=redir;
};
var count=0;
function setCount(){
count=1;
};
function getCont(div){
var _1d=document.getElementsByTagName("title")[0].innerHTML;
var _1e="";
_1e+="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
_1e+="<html xmlns=\"http://www.w3.org/1999/xhtml\">";
_1e+="<head>";
_1e+="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />";
_1e+="<title>"+_1d+"</title>";
_1e+="<link href=\"../css/sib_print.css\" rel=\"stylesheet\" type=\"text/css\" />";
_1e+="</head>";
_1e+="<body>";
_1e+="<div style=\"height:108; padding-top:6px; padding-bottom:8px;\"><img src=\"../img/printheader.jpg\" alt=\"Scienceinthebox.com\" width=\"595\" height=\"108\" /></div>";
var end="";
end+="</body>";
end+="</html>";
if(!Array.prototype.map){
Array.prototype.map=function(fun){
var len=this.length;
if(typeof fun!="function"){
throw new TypeError;
}
var res=new Array(len);
var _23=arguments[1];
for(var i=0;i<len;i++){
if(i in this){
res[i]=fun.call(_23,this[i],i,this);
}
}
return res;
};
}
if(!Array.prototype.filter){
Array.prototype.filter=function(fun){
var len=this.length;
if(typeof fun!="function"){
throw new TypeError;
}
var res=new Array;
var _28=arguments[1];
for(var i=0;i<len;i++){
if(i in this){
var val=this[i];
if(fun.call(_28,val,i,this)){
res.push(val);
}
}
}
return res;
};
}
function obValsl(ob){
try{
if(ob&&ob.length){
var r=[],i=0,mx=ob.length;
for(var z=0;z<mx;z++){
r[z]=ob[z]||undefined;
}
}
}
catch(yy){
alert(yy);
}
return r;
};
function tags(elm,tid){
if(tid){
if(elm.isString){
elm=el(elm);
}
return obValsl(elm.getElementsByTagName(tid));
}
return obValsl(document.getElementsByTagName(elm));
};
function kill(tr){
tr.parentNode.removeChild(tr);
};
if(count==0){
tags("script").map(kill);
}
var pWidth=612;
var pHeight=842;
var pLeft=(screen.width-pWidth)/2;
var pTop=(screen.height-pHeight)/2;
var _33=document.getElementById(div).innerHTML;
printwindow=window.open("","","width="+pWidth+",height="+pHeight+",top="+pTop+",left="+pLeft+",location=no,menubar=no,titlebar=no,resizable=no,scrollbars=yes,status=no,toolbar=no");
printdocument=printwindow.document;
printdocument.writeln(_1e);
printdocument.writeln(_33);
printdocument.writeln(end);
setTimeout ("printWindow(printwindow)", 3000);
function printWindow(elem){elem.print();}
setCount();
};

function googlesearch(){
  // Create a search control
  var searchControl = new google.search.SearchControl();

  // Add a WebSearcher
  searchControl.addSearcher(new google.search.WebSearch());

  // Set a callback so that whenever a search is started we will call searchStart
  searchControl.setSearchStartingCallback(this, searchStart);



  // execute an inital search
  searchControl.execute("VW GTI");

}
function searchStart(searchControl, searcher, query) {
  var content = document.getElementById('centerBlock');
  var queryDiv = document.getElementById('query');
  if (! queryDiv) {
    var queryDiv = document.createElement('div');
    queryDiv.id = 'query';
    document.body.appendChild(queryDiv);
  }
  queryDiv.innerHTML = "User searched for: " + query;
}

function loadjscssfile(filename, filetype){
 if (filetype=="js"){ //if filename is a external JavaScript file
  var fileref=document.createElement('script')
  fileref.setAttribute("type","text/javascript")
  fileref.setAttribute("src", filename)
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
 }
 if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}


// include google site search
google.load("jquery", "1");
google.load("search", "1");
google.setOnLoadCallback(function() {
  $(function() {

    $('#centerContainer').prepend('<div id="cse" style="width:100%;"></div>');
    
    var customSearchControl = new google.search.CustomSearchControl('011512088232477975834:0bdkkgtkzgy');
    //customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
    customSearchControl.draw('cse-search-form');	
    
    var options = new google.search.DrawOptions();
    options.setSearchFormRoot('cse-search-form');
    options.setAutoComplete(true);
    customSearchControl.draw('cse', options);   

    // restyling of the created search box
    $('.gsc-input').css({'background':'transparent'});    // reset google watermark
    $('input.gsc-input').css({'background':'#fff'}).before('<label for="'+$('input.gsc-input').attr('id')+'" class="label">Search Science in the box</label>');
    $('input.gsc-search-button').before('<div class="label">&nbsp;</div>');
    $('.gsc-search-button').val('>>'); // replace deafault text value "search"
    
    // search results
    customSearchControl.setSearchStartingCallback(this, function () {
        var oResultbox = $('#cse'); 
        $('#centerContainer')
              .empty()    // clear content before adding any results
              .append('<h1 class="gs-result">Search Results</h1>') // add a nice headline
              .append(oResultbox); // set the remembered result box  
    });

  });
}, true);

// include styles for google site search
loadjscssfile("../css/search.css", "css");
