gettheme = 0
function getAllSheets() {
	if( !window.ScriptEngine && navigator.__ice_version ) { return document.styleSheets; }
	if( document.getElementsByTagName ) { var Lt = document.getElementsByTagName('link'), St = document.getElementsByTagName('style');
	} else if( document.styleSheets && document.all ) { var Lt = document.all.tags('LINK'), St = document.all.tags('STYLE');
	} else { return []; } for( var x = 0, os = []; Lt[x]; x++ ) {
		var rel = Lt[x].rel ? Lt[x].rel : Lt[x].getAttribute ? Lt[x].getAttribute('rel') : '';
		if( typeof( rel ) == 'string' && rel.toLowerCase().indexOf('style') + 1 ) { os[os.length] = Lt[x]; }
	} for( var x = 0; St[x]; x++ ) { os[os.length] = St[x]; } return os;
}
function changeStyle() {
	if (gettheme == 1) {
		document.getit.theme.value = "undefined";
	}
	window.userHasChosen = window.MWJss;
	for (var x = 0, ss = getAllSheets(); ss[x]; x++) {
		if (ss[x].title) {
			ss[x].disabled = true;
		}
		for (var y = 0; y < arguments.length; y++) {
			if (ss[x].title == arguments[y]) {
				ss[x].disabled = false;
				if (gettheme == 1) {
					document.getit.theme.value = ss[x].title;
				}
				if (gettheme == 2) {
					document.InfoForm.theme.value = ss[x].title;
				}
			}
		}
	}
}

function rememberStyle(cookieName,cookieLife) {
	for( var viewUsed = false, ss = getAllSheets(), x = 0; window.MWJss && ss[x]; x++ ) { if( ss[x].disabled != MWJss[x] ) { viewUsed = true; break; } }
	if( !window.userHasChosen && !viewUsed ) { return; }
	for( var x = 0, outLine = '', doneYet = []; ss[x]; x++ ) {
		if( ss[x].title && ss[x].disabled == false && !doneYet[ss[x].title] ) { doneYet[ss[x].title] = true; outLine += ( outLine ? ' MWJ ' : '' ) + escape( ss[x].title ); } }
	if( ss.length ) { document.cookie = escape( cookieName ) + '=' + escape( outLine ) + ( cookieLife ? ';expires=' + new Date( ( new Date() ).getTime() + ( cookieLife * 86400000 ) ).toGMTString() : '' ) + ';path=/'; }
}
function useStyleAgain(cookieName) {
	
	for( var x = 0; x < document.cookie.split( "; " ).length; x++ ) {
		var oneCookie = document.cookie.split( "; " )[x].split( "=" );
		if( oneCookie[0] == escape( cookieName ) ) {
			var styleStrings = unescape( oneCookie[1] ).split( " MWJ " );
			for( var y = 0, funcStr = ''; styleStrings[y]; y++ ) { funcStr += ( y ? ',' : '' ) + 'unescape( styleStrings[' + y + '] )'; }
			eval( 'changeStyle(' + funcStr + ');' ); break;
	} } window.MWJss = []; for( var ss = getAllSheets(), x = 0; ss[x]; x++ ) { MWJss[x] = ss[x].disabled; }
	
	if(gettheme == 1){
		document.getit.theme.value = oneCookie[1];
	}
}

var loaded = 0;

function PreLoad() {
	
if (document.images != null) {

clickme0 = new Image();
clickme0.src = "http://www.iias.com/images/interface/spacer-clear.gif";

if (navigator.appName == "Microsoft Internet Explorer") {
	clickme1 = new Image();
	clickme1.src = "http://www.iias.com/images/interface/spacer-clear.gif";
} else {
	clickme1 = new Image();
	clickme1.src = "http://www.iias.com/images/interface/spacer-clear.gif";
}

clickme2 = new Image();
clickme2.src = "http://www.iias.com/images/menu/arrow.png";

}
	loaded = 1;
}

function hiLite(imgDocID,imgObjName) {
if (document.images !=null) {
 if (loaded)
  document.images[imgDocID].src = eval(imgObjName + ".src")
 }
}

function highlight(imgDocID,imgObjName) {
i = new Image();
i.src = imgObjName;
if (document.images != null) {
 if (loaded)
  document.images[imgDocID].src = i.src
 }
}

var persistmenu="yes" //"yes" or "no"
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for current page only

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

function popup(winName,URL,height,width) {
 var popup = window.open(URL,winName,"height=" + height + ",width=" + width + ",left=28,top=25,status=0,scrollbars=1,toolbar=0,directories=0,menubar=0,location=0");
 NewWindow = popup;
 NewWindow.focus();
}

function popupVideo(winName,URL,height,width) {
 posTop = (screen.height / 2) - 157;
 posLeft = (screen.width / 2) - 165;
 var popup = window.open(URL,winName,"height=" + height + ",width=" + width + ",left=" + posLeft + ",top=" + posTop + ",status=0,scrollbars=0,toolbar=0,directories=0,menubar=0,location=0");
 NewWindow = popup;
 NewWindow.focus();
}

function popup1(status,url) {
 
 var adWidth = 470;
 var adHeight = 400;

  if (screen) {
   var bottom = screen.availHeight;
   var right = screen.availWidth;
   var pos_x = parseInt((right- adWidth)/2) ;
   var pos_y = parseInt((bottom - adHeight)/2);
   } else {
   pos_x = 30;
   pos_y = 50;
  }
 
 if(status != 0) {
 if(popup != null) popup.focus(); 
 else { 
 var popup = open(url, "popup", "HEIGHT=" + adHeight + ",WIDTH=" + adWidth + ",left=" + pos_y + ",top=" + pos_y + ",status=1,scrollbars=yes,toolbar=no,directories=no,menubar=no,location=no,resizable=1");
 popup_window = popup;
 popup_window.focus();
 }
 } else {
 if(popup_window != null) popup_window.close();
 }
}

var check = false;

function init() {				//  alert ("Running Init");

if (document.layers) {				//  alert ("Running Netscape 4");

 layerRef="document.layers";
 styleSwitch="";
 visibleVar="show";
 agent ="ns4";

} else if (document.all) {			//  alert ("Running IE");

 layerRef="document.all";
 styleSwitch=".style";
 visibleVar="visible";
 agent ="ie";

} else if (document.getElementById) {		//  alert ("Running Netscape 6");

 layerRef="document.getElementByID";
 styleSwitch=".style";
 visibleVar="visible";
 agent="moz";

} else {					//  alert("Older than 4.0 browser.");

 agent="none";
 newbrowser = false;

}
						//  window.status='status bar text to go here';
check = true;
}

// Turn layers on and off

function showLayer(layerName) {

if (check) {
 if (agent=="none") {
  return;
 } else if (agent=="moz") {
  document.getElementById(layerName).style.visibility="visible";
  document.getElementById(layerName).style.display="";
 } else if (agent=="ie") {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="block"');
 } else {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="block"');
 }
} else {					// alert ("Please wait for the page to finish loading.");
 return;
}
}

function hideLayer(layerName) {

if (check) {
 if (agent=="none") {
  return;
 } else if (agent=="moz") {
  document.getElementById(layerName).style.visibility="hidden";
  document.getElementById(layerName).style.display="none";
 } else if (agent=="ie") {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="none"');
 } else {
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.display="none"');
 }
} else {					//  alert ("Please wait for the page to finish loading.");
 return;
}
}

function hideAllemark() {
 hideLayer('subone');
 hideLayer('subtwo');
 hideLayer('subthree');
 hideLayer('dropfour');
 hideLayer('dropfive');
}

function hideAllPort() {
 hideLayer('a');
 hideLayer('b');
 hideLayer('c');
 hideLayer('d');
 hideLayer('e');
 hideLayer('f');
 hideLayer('g');
 hideLayer('h');
 hideLayer('i');
 hideLayer('j');
}

function hideAllHost() {
 hideLayer('basic');
 hideLayer('starter');
 hideLayer('pro');
 hideLayer('basic-html');
 hideLayer('starter-html');
 hideLayer('pro-html');
}