// JavaScript Document

// drop down function
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  if (targ == 'blank') { 
  	win = window.open(selObj.options[selObj.selectedIndex].value, 'newwindow')
  } else {
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
  }
}

// bookmark function
var urlAddress = self.location.href;
var pageName = document.title;

 function addToFavorites()
 {
  if (window.external)
  {
   window.external.AddFavorite(urlAddress,pageName)
  }
  else
  { 
   alert("Sorry! Your browser doesn't support this function.");
  }
 }
function addBookmark(){
	if(window.sidebar){ // Firefox
		window.sidebar.addPanel(pageName, urlAddress,'');
	}
	else if(window.opera){ //Opera
		var a = document.createElement("A");
		a.rel = "sidebar";
		a.target = "_search";
		a.title = pageName;
		a.href = urlAddress;
		a.click();
	}
	else if(document.all){ //IE
		window.external.AddFavorite(urlAddress, pageName);
	}
	else
	{ 
		alert("You need to press Ctrl+D to bookmark our website.");
	}

}
// email to a friend
function EmailLink(){
window.location = "mailto:"+"?subject=Kingspan Off-Site" + "&body=" + "I thought this link might interest you:  " + document.title + "  " + location.href;
}

// accessible popup window
var newWin = null; 
function popUpWin(strURL, strType, strHeight, strWidth) { 
 if (newWin != null && !newWin.closed) 
   newWin.close(); 
 var strOptions=""; 
 if (strType=="console") 
   strOptions="resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixed") 
   strOptions="status,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="fixedscroll") 
   strOptions="status,scrollbars,screenX=300,left=300,screenY=200,top=50,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="elastic") 
   strOptions="scrollbars,"+ 
     "resizable,height="+ 
     strHeight+",width="+strWidth; 
 if (strType=="print_access")
   strOptions="scrollbars,menubar,status,resizable,height="+strHeight+",width="+strWidth; 
 newWin = window.open(strURL, 'newWin', strOptions); 
 newWin.focus(); 
}

function popUp(strURL, strType, strHeight, strWidth){
newwindow=window.open(strURL,'','height='+strHeight+',width='+strWidth)
newwindow.document.writeln('<html><head><title>Kingspan Off-Site<\/title><style type=text\/css>body, img, td, table, tr{padding:0;margin:0;border:0;}<\/style><\/head><body bgcolor=\"white\"><table align=center width='+strWidth+' height=100%><tr><td align=center valign=middle>');
newwindow.document.writeln('<img align=absmiddle src=' + strURL + '>');
newwindow.document.writeln('</td></tr></table><\/body><\/html>');
newwindow.focus();
}