//standart script
var button_num = 8;
if(!backtotop) var backtotop="";

//generate randum numbers to change design

//Init globalNum;
var globalNum=1;

temp=Math.random();
//if(isTop=="global"){

if ((temp < 0.45) && (temp >= 0)) globalNum="";
else if ((temp >= 0.45) && (temp < 0.9)) globalNum="_1";
else globalNum="_2";

//}else{

//if (temp < 0.5) globalNum="";
//else globalNum="_1";

//}

//menu generating script
function setSideMenu(n,k){
	
	isTop="";
	if(k==1){
		isTop="_down";
		globalNum="";
	}
	
	switch(n){
	case 0:
	_temp='<tr><td class="menubox" style="background-image: url('+imgFolder+'img/global'+globalNum+"/"+divName+'_img_back'+ isTop +'.jpg); color: #FFFFFF; background-color: ';

	switch(divName){
		case "nur": _temp+="#FF99CC;"; break;
		case "med": _temp+="#6699CC;"; break;
		case "hos": _temp+="#94DB4D;"; break;
		//case "hos": _temp+="#66CC00;"; break;
		case "post_med": _temp+="#9999CC;"; break;
		case "post_nur": _temp+="#FFCCFF;"; break;
		case "univ_outline": _temp+="#3399CC;"; break;
		case "access": _temp+="#3399CC;"; break;
		case "search": _temp+="#3399CC;"; break;
		case "inst": _temp+="#FFCC99;"; break;
		case "sitemap": _temp+="#3399CC;"; break;
		case "life": _temp+="#3399CC;"; break;
	}

	_temp+='">';
	break;

	case 1:
	_temp='</td></tr>';
	break;
	}
	
	return _temp;
}



function setMainVisual(n){
	_temp ='<a href="'+imgFolder+'index.html"><img src="'+imgFolder+'img/global'+globalNum+'/'+divName+'_img_main1.jpg" alt="'+backtotop+'" width="569" height="43" border="0" /></a><br />';
	_temp+='<img src="'+imgFolder+'img/global'+globalNum+'/'+divName+'_img_main.jpg" width="569" height="176" />';
	return _temp;
}



function std_swap(n){
	if (menu_num != n){
	eval("MM_swapImage('b"+ n +"','','../img/navi_button" + n + "_f2.gif',0)");
	}
}

function std_swapout(n){
	if (menu_num != n){
	eval("MM_swapImage('b"+ n +"','','../img/navi_button" + n + ".gif',0)");
	}
	
	for (i=1;i<=button_num;i++){
		eval("MM_showHideLayers('t"+ i +"','','hide')");
	}

}

function std_swap_sub(n){
	if (sub_num != n){
	eval("MM_swapImage('bs"+ n +"','','../img/sub_button" + menu_num + "_" + n + "_f2.gif',0)");
	}
}

function std_swapout_sub(n){
	if (sub_num != n){
	eval("MM_swapImage('bs"+ n +"','','../img/sub_button" + menu_num + "_" + n + ".gif',0)");
	}
	
	for (i=1;i<=button_num;i++){
		eval("MM_showHideLayers('t"+ i +"','','hide')");
	}

}


function close_lay(n){
	eval("MM_showHideLayers('k"+ n +"','','hide')");
	//menu_num = 0;

}

function pop_title(n){
	for (i=1;i<=button_num;i++){
		eval("MM_showHideLayers('t"+ i +"','','hide')");
	}

	eval("MM_showHideLayers('t"+ n +"','','show')");

}

function open_lay(n){
	//menu_num = n;

	for (i=1;i<=button_num;i++){
		eval("MM_showHideLayers('k"+ i +"','','hide')");		

	}

	eval("MM_showHideLayers('k"+ n +"','','show')");

}

function open_window1(teacher_name,n){
	eval("MM_openBrWindow('" + teacher_name + ".html','card" + n + "','scrollbars=yes,width=600,height=400')");
}


function card_swap(){
	eval("MM_swapImage('b"+ 1 +"','','../../img/card_button_teacher" + cate_num + "_f2.gif',0)");
}

function open_card(teacher_name,n){
	eval("MM_openBrWindow('" + teacher_name + ".html','card" + n + "','scrollbars=yes,width=600,height=400')");
}

function write_history(){

	his_length = make_history.length;
	top.BREAD.document.open();
	top.BREAD.document.write('<html><body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">');
	top.BREAD.document.write('<table border="0" cellspacing="0" cellpadding="0" width="100%">');
	top.BREAD.document.write('<tr><td style="font-size: 11px">&nbsp;');
	for (i=0;i<his_length;i++){
		if (i != (his_length-1)){
		top.BREAD.document.write('<a href="' + make_history_url[i] + '" target="MAIN">');
		top.BREAD.document.write(make_history[i]);
		top.BREAD.document.write('</a>')
		top.BREAD.document.write(' &gt;&gt; ')
		}else{
		top.BREAD.document.write(top.MAIN.make_history[i]);
		}
	}
	top.BREAD.document.write('</td><td align="right" nowrap>');
	top.BREAD.document.write('<a href="javascript:top.MAIN.location.hash=\'top\'"><img src="../img/bottom_button_backup.gif" border="0"></a>');
	top.BREAD.document.write('<a href="../top/index.html" target="MAIN"><img src="../img/bottom_button_backtop.gif" border="0"></a>');
	top.BREAD.document.write('<a href="../top/sitemap.html" target="MAIN"><img src="../img/bottom_button_sitemap.gif" border="0"></a>');
	top.BREAD.document.write('<a href="../top/contact.html" target="MAIN"><img src="../img/bottom_button_contact.gif" border="0"></a>');

	top.BREAD.document.write('</td></tr>');
	top.BREAD.document.write('</table></body></html>');
	top.BREAD.document.close();
}

function open_explanation(ks){
			close_explanation();
			eval("MM_showHideLayers('s"+ ks +"','','show')");

}

function close_explanation(){
		for (i=1;i<=10;i++){
			eval("MM_showHideLayers('s"+ i +"','','hide')");
		}

}

function open_window(target_url){
		target_url="../campus_map/"+target_url;
		MM_openBrWindow(target_url,'campusmap','status=yes,scrollbars=yes,resizable=yes,width=600,height=380')
}



//functions for open new window
function openWin(_url){
	MM_openBrWindow(_url,'newwin','scrollbars=yes,resizable=yes,width=540,height=360');
}


//dreamweaver control script


	//netscape reload script
	
	function MM_reloadPage(init) {  //reloads the window if Nav4 resized
	  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);
	
	
	function MM_findObj(n, d) { //v4.0
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && document.getElementById) x=document.getElementById(n); return x;
	}
	
	//script to swap image
	
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	function MM_preloadImages() { //v3.0
	  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
		var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}
	
	function MM_openBrWindow(theURL,winName,features) { //v2.0
	
	  window.open(theURL,winName,features);
	}
	
		
	function MM_showHideLayers() { //v3.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		obj.visibility=v; }
	}

