    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 1000;
		var what = null;
		var newbrowser = true;
		var check = false;

    	function init(){
    	  // alert ("Running Init");
          if (document.layers) {
                        // alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
                        // alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
                        // alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";

		  }else{
		  	// alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }


		window.status='PIONEER';
		check = true;

		callBack();
  	 	}

  	 	function callBack()
  	 	{
  	 		//nothing
  	 	}

	// Turns the layers on and off
        function showLayer(layerName, obj){
            var ndl;
        	if(check){
        		if (what =="none"){
        			return;
        			}
        	    left=findPos(obj);
        		document.getElementById(layerName).style.left=left;
	        	if (what == "moz"){
        			document.getElementById(layerName).style.visibility="visible";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
				  ndl = document.getElementsByTagName("select");
				  if (ndl){
					for (i=0; i<ndl.length; ++i){
					  var obj = ndl[i];
					  if (obj.name != "profileID"){
					  	if (obj && obj.offsetParent && obj.style){
							obj.style.visibility = 'hidden';
							}
						}
					 }
				  }
		     }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
		}

        function hideLayer(layerName){
            var ndl;
        	if(check){
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="hidden";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
				  ndl = document.getElementsByTagName("select");
				  if (ndl){
					for (i=0; i<ndl.length; ++i){
					  var obj = ndl[i];
					  if (obj && obj.offsetParent && obj.style){
						obj.style.visibility = 'visible';
						}
					 }
				  }
				}

        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
        }


		function hideAll(){
				hideLayer('layer1');
				}


		function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll()" , timecount);
                timerOn = true;

	        }

		}


		function stopTime() {
	        if (timerOn) {
    	        clearTimeout(timerID);
                timerID = null;
                timerOn = false;
	        }
		}

		function onLoad(){
			init();
			}

function findPos(obj) {
	var curleft = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
		}
	}
	return [curleft];
}
/* Pioneer.com */
function tabOn(obj){
	obj.className ="goldtab";
}
function tabOff(obj){
	obj.className ="greentab";
}

function showCountryPicker(obj){
	buildCountryPicker();
	hideAll();
	showLayer('layer1', obj);
	stopTime();
}

var countryPickerBuilt = false;
var countries = [];
function buildCountryPicker(){
	if(!countryPickerBuilt){
		tblBody = document.getElementById("countryTBody");
		if(tblBody == null || countries==null || countries.length==null){
			return;
		}
		countryPickerBuilt = true;

        // creating all cells
        for (var i = 0; i < countries.length; i++) {
            // creates a table row
            var row = document.createElement("tr");

            // Create a <td> element and a text node, make the text
            // node the contents of the <td>, and put the <td> at
            // the end of the table row
            var cellText = document.createTextNode(countries[i][2]);
			var img = document.createElement("img");
			img.setAttribute("src", "/staticweb/images/flags/"+countries[i][1]);

			var link = document.createElement("a");
			//link.setAttribute("href", "/web/site/portal/menuitem."+countries[i][0]);
			link.setAttribute("href", countries[i][0]);
			link.appendChild(img);
			link.appendChild(cellText);

            var cell = document.createElement("td");
            cell.appendChild(link);

			if(i%2==0){
				cell.className="navEven";
			}else{
				cell.className="navOdd";
			}

            // add the row to the end of the table body
            row.appendChild(cell);
            tblBody.appendChild(row);
        }
	}
}


function defaultEmailLink(name, attributes){
	document.writeln("<a"+attributes+" href=\"mailto:"+name+"@budmans.com\">"+name+"@budmans.com</a>");
}
function defaultEmailLink2(name, params, attributes){
	document.writeln("<a"+attributes+" href=\"mailto:"+name+"@budmans.com?"+params+"\">"+name+"@budmans.com</a>");
}

function emailLink(name, domain, attributes){
	document.writeln("<a"+attributes+" href=\"mailto:"+name+"@"+domain+"\">"+name+"@"+domain+"</a>");
}
function emailLink2(name, domain, params, attributes){
	document.writeln("<a"+attributes+" href=\"mailto:"+name+"@"+domain+"?"+params+"\">"+name+"@"+domain+"</a>");
}

function fullEmailLink(name, domain, name2, domain2, attributes){
    if(domain2.length==0){
        document.writeln("<a"+attributes+" href=\"mailto:"+name+"@"+domain+"\">"+name2+"</a>");
    }else{
        document.writeln("<a"+attributes+" href=\"mailto:"+name+"@"+domain+"\">"+name2+"@"+domain2+"</a>");
    }

}
function fullEmailLink2(name, domain, params, name2, domain2, attributes){
    if(domain2.length==0){
        document.writeln("<a"+attributes+" href=\"mailto:"+name+"@"+domain+"?"+params+"\">"+name2+"</a>");
    }else{
        document.writeln("<a"+attributes+" href=\"mailto:"+name+"@"+domain+"?"+params+"\">"+name2+"</a>");
    }

}

function getMovieName(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
   }
   else {
       return document[movieName];
   }
}

function clearMCopyDiv(str) {
  document.getElementById("mCopyDiv").innerHTML = "";
  return "clear"
}

function callExternalInterface(whatType, name, title, mediaCopy) {
    getMovieName("myMovie").callMediaInputs(whatType, name, title);
    document.getElementById("mCopyDiv").innerHTML = mediaCopy;
}

function showImg(scr, field, txt) {
            document.getElementById(field).innerHTML = txt;
}

function divVisible(strHide, strShow){
            var arrHide = new Array();
            arrHide = strHide.split(',');
            for(i=0;i<arrHide.length;i++){
                        document.getElementById(arrHide[i]).style.display='none';
            }
            var arrShow = new Array();
            arrShow = strShow.split(',');
            for(i=0;i<arrShow.length;i++){
                        document.getElementById(arrShow[i]).style.display='inline';
            }
}

gSlideshowInterval = 8;
gNumberOfImages = 1;
gCurrentImage = 0;
gImageFolder = "";
gImageCapableBrowser = canManipulateImages();
gArrImages = new Array();
gLoadedOnce = 0;

function canManipulateImages() {
            if (document.images)
                        return true;
            else
                        return false;
}
function loadSlide(imageURL) {
            if (gImageCapableBrowser) {
                        document.slide.src = gImageFolder + imageURL;
                        return false;
            }
            else {
                        return true;
            }
}
function nextSlide() {
            gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
            loadSlide(gArrImages[gCurrentImage]);
}
function fncSetupRotate(strLoc, strImages, intervalVal){
            if(gLoadedOnce==0){
                        gImageFolder = strLoc;
                        gArrImages = strImages.split(",")
                        gNumberOfImages = gArrImages.length;
                        gSlideshowInterval = intervalVal
                        setInterval("nextSlide()",gSlideshowInterval * 1000);
                        gLoadedOnce = 1;
            }
}
