function printpage(siteURL, pageTitle, theWidth, theHeight) {
  theWidth  = theWidth  == 0 ? 100 : theWidth;
  theHeight = theHeight == 0 ? 100 : theHeight;
  myPopup = window.open(siteURL + '/print/' + pageTitle,'InterviewNotes','width=' + theWidth + ',height=' + theHeight + ',resizable=no,scrollbars=yes,status=no');
}

function clearText(theField)
  {
    if (theField.defaultValue == theField.value)
      theField.value = '';
  }
 
  function addText(theField)
  {
    if (theField.value == '')
      theField.value = theField .defaultValue;
  }

function new_freecap()
{
		// loads new freeCap image
	if(document.getElementById)
	{
			// extract image name from image source (i.e. cut off ?randomness)
			thesrc = document.getElementById("freecap").src;
			thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);
			// add ?(random) to prevent browser/isp caching
			document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);
	} else {
			alert("Sorry, cannot autoreload freeCap image\nSubmit the form and a new freeCap will be loaded");
	}
}


// suckerfish menu

sfHover = function()
{
    if (document.getElementById("vertical"))
    {
      	var sfEls = document.getElementById("vertical").getElementsByTagName("LI");
      	
        for (var i = 0; i < sfEls.length; i++)
        {
        		sfEls[i].onmouseover = function()
            {
        			 this.className += " sfhover";
        		}
        		
        		sfEls[i].onmouseout = function()
            {
        			 this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
        		}
      	}
  	}
    else
    {
        //alert('Can not find V menu');
    }

    if (document.getElementById("horizontal"))
    {
      	var sfElsH = document.getElementById("horizontal").getElementsByTagName("LI");
      	
        for (var i = 0; i < sfElsH.length; i++)
        {
        		sfElsH[i].onmouseover = function()
            {
        			 this.className += " sfhover";
        		}
        		
        		sfElsH[i].onmouseout = function()
            {
        			 this.className = this.className.replace(new RegExp(" sfhover\\b"), "");
        		}
      	}
  	}
  	else
    {
        //alert('Can not find H menu');
    }
}

if (window.attachEvent) window.attachEvent("onload", sfHover);

/* function $(idName) {
	return document.getElementById(idName);
} */

start=0;
function showCont() {
//	$("extContainer").style.backgroundImage="none";
	start+=40;
	
	$("dynCont").style.filter = "alpha(opacity="+start+")";
	$("containerCenter").style.filter = "alpha(opacity="+start+")";
	
	opa = start /100;
	$("dynCont").style.MozOpacity = opa;
	$("containerCenter").style.MozOpacity = opa;
	
	if(start<=100) {	
		setTimeout("showCont()",10);
	}
	else {
		
		//$("extTopRCorn").innerHTML = '<div onclick="reverse();" style="width:30px; height:13px;background-image:url(\'/templates/default/images/_close_button.gif\');background-repeat: no-repeat;cursor:pointer;position:relative;right:25px;top:9px;z-index:100002">&nbsp;</div>';
		$("extTopRCorn").innerHTML = ' ';
	}
}



var incX = 60;
var incY = 0; // -12
var diff = 11;
var startX = 138;
var startY = 350;
var mainBox = 0;
var firstWidth = 350;
var secWidth = 675;
var contCentWidth = 554;
var leftContWidth = 187;


// out setters
var toWhatX = startX;
var toWhatY = startY;
var toWhatL = leftContWidth;
var toWhatC = contCentWidth;

var baackup = false;

function hiTech(id) {

	if(id<0)
		level = firstWidth;
	else
		level = secWidth;
	
	if(baackup==false) {
		$("backup").innerHTML = $("containerCenter").innerHTML;
		baackup = true;
	}
	
	mainBox = 52 + startX;
	$("extContainer").innerHTML = "";
	$("containerCenter").innerHTML = "";
	$("containerCenter").style.filter = "alpha(opacity=0)";
	$("containerCenter").MozOpacity = 0;
	
	// Horizontal slide
	$("extTopMid").style.width = startX + "px";
	$("extContainer").style.width = (startX + diff) + "px";
	$("extBotMid").style.width = startX + "px";
	$("mechContainer").style.width = mainBox + "px";
	$("containerLeft").style.width = leftContWidth + "px";	
	$("containerCenter").style.width = (contCentWidth) + "px";	
	
	
	// Vertical slide
	//$("extMidLWall").style.height = startY + "px";
	//$("extContainer").style.height = startY + "px";
	//$("extMidRWall").style.height = startY + "px";
	
	if(startX<level) { 
		startX += incX;
		//startY += incY;
		leftContWidth += incX;
		contCentWidth -= incX;
		setTimeout("hiTech("+id+");",1);
		
	} else {
		//alert("x: "+startX+" pixels, y: "+startY+" pixels");
	//	$("extContainer").innerHTML = '<div id="dynCont" ></div>';		
		$("extContainer").innerHTML = '<div id="titl" style="color: #001a97;font-size: 11px;font-weight:bold;margin-top:3px; float:left; width:50%;"></div><div onclick="reverse();" style="float:right; margin-right:3px; width:35px;  z-index:100002;"><a onclick="reverse();" href="#"><img src=\'/templates/default/images/_close_button.gif\' border="0"/></a></div><div id="dynCont" style="position:relative;left:-20px;top:-7px; clear:both;"></div>';
		//$("dynCont").style.height = (startY-15) + "px";
		$("dynCont").style.width = (startX+20) + "px";
		//alert(id);
		if(id>=0)
			$("dynCont").style.overflow="auto";
			
		getContent(id);
	}
	
	
	
}
function putCont(con) {
$("titl").innerHTML = con;

}

function getContent(id) {
	
	var urla = "";
	
	if(id<=0){ 
		urla = '/leftMenu';
	}
	else{ 
		urla = '/getContent';
		//$("extContainer").style.overflow = "vertical";
		//$("extContainer").style.height = "510px";
		//$("extContainer").style.padding = "10px";
		//$("leftFlowContainer").style.overflow="auto";
	}
	
	advAJAX.get({
    url: urla,
    parameters : {
      "id" : id,
      "ajax" : "true"     
    },
    
	
	
    onInitialization : function(obj) {
    	/*$("dynCont").style.backgroundImage = "url('/templates/default/images/bigrotation2.gif')";
		$("dynCont").style.backgroundRepeat = "no-repeat";
		$("dynCont").style.backgroundPosition = "center center";*/
		if(id!=0) {
		//$("dynCont").style.filter = "alpha(opacity=0)";
	  	//$("dynCont").style.MozOpacity = 0;
	  	}
    },
        
    onSuccess : function(obj) {        
	  $("dynCont").style.background = "none";
	  
	  
    },
    
    onFinalization : function(obj) {
	
		//alert(obj.responseText);
	
    	if(id==0)
			$("extContainer").innerHTML = '<div style="height:420px; padding:10px; overflow:auto; margin-top:10px;">'+obj.responseText+'</div>';
		else if (id == -1){
    		$("dynCont").innerHTML = '<div style="height:420px; padding:10px; overflow:none; margin-top:10px;">'+obj.responseText+'</div>';
		}else{
			$("dynCont").innerHTML = '<div style="height:420px; padding:10px; overflow:auto; margin-top:10px;">'+obj.responseText+'</div>';
		}
			
    	aske = $("ortit").innerHTML;
    	putCont(aske);
	  
    },
    
    onError : function(obj) {        
        alert("Error: " + obj.status);
    }
    
});

if(id<0) {

advAJAX.get({
    url: "/industry2",
    parameters : {
      
      "ajax" : "true"     
    },
    
    onSuccess : function(obj) {        
	  $("containerCenter").innerHTML = obj.responseText;
    },
    
    onError : function(obj) {        
        alert("Error: " + obj.status);
    }
    
});

}



showCont();

return true;
}

var staart = 0;


function showLeftSide() {
			
		staart+=55;

		$("extContainer").style.filter = "alpha(opacity="+staart+")";
		$("containerCenter").style.filter = "alpha(opacity="+staart+")";
		
		opa = staart /100;
		$("extContainer").style.MozOpacity = opa;
		$("containerCenter").style.MozOpacity = opa;
		if(staart<100) {	
			setTimeout("showLeftSide()",1);
		} else 		{	
			staart = 0;
			//alert(baackup);
			$("containerCenter").innerHTML = $("backup").innerHTML;
			$("containerCenter").style.filter = "alpha(opacity=100)";
			$("containerCenter").MozOpacity = 1;			
		}

}


function reverse() {
	
	start-=57;
	//$("titl").innerHTML = "";
	if($("dynCont")) {
		$("dynCont").style.filter = "alpha(opacity="+start+")";
		opa = start /100;
		$("dynCont").style.MozOpacity = opa;
	}
	if(start>0) {	
		setTimeout("reverse()",1);
	}
	else {
		
		
		mainBox = 52 + startX;
		//$("extContainer").style.filter = "alpha(opacity=0)";
		//$("extContainer").style.MozOpacity = 0;
		$("containerCenter").innerHTML = "";
	
		// Horizontal slide
		$("extTopMid").style.width = startX + "px";
		$("extContainer").style.width = (startX + diff) + "px";
		$("extBotMid").style.width = startX + "px";
		
		$("mechContainer").style.width = mainBox + "px";
	
		// Vertical slide
		//$("extMidLWall").style.height = startY + "px";
		//$("extContainer").style.height = startY + "px";
		//$("extMidRWall").style.height = startY + "px";
	
		if(startX>toWhatX) { 
			startX -= incX;
			//startY -= incY;
			setTimeout("reverse();",1);
		
		} else {
			$("extTopRCorn").innerHTML = '';
			//$("containerCenter").innerHTML = $("backup").innerHTML;
			//alert($("backup").innerHTML);
			
			$("containerLeft").style.width = toWhatL + "px";	
			$("containerCenter").style.width = toWhatC + "px";
			leftContWidth = toWhatL;
			contCentWidth = toWhatC;
			
			
			
			urla = '/leftMenu';
			advAJAX.get({
				url: urla,
				parameters : {
				  "id" : "0",
				  "ajax" : "true"     
				},
				
				 onFinalization : function(obj) {
					$("extContainer").innerHTML = obj.responseText;
					//alert(obj.responseText);
				},

				onError : function(obj) {        
					alert("Error: " + obj.status);
				}
			});
			
			
			$("containerCenter").innerHTML = $("backup").innerHTML;
			//$("dynCont").style.filter = "alpha(opacity=0)";
			//$("dynCont").style.MozOpacity = 0;	
			//getContent(0);
			//getContent(1);
			//showLeftSide();

		}
	}
}


