

function popUp(URL) {
	var day = new Date();
	var id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=400,left = 550,top = 325');");
}
function popUp(URL,width,height) {
	var day = new Date();
	var id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + width + ",height=" + height +",left = 550,top = 325');");
}
function PrintPopUp(URL) {
	var day = new Date();
	var id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=690,height=700,left = 450,top = 225');");
}

/*
var ns4=(navigator.appName=='Netscape' && parseInt(navigator.appVersion)==4);
var ns6=(document.getElementById)? true:false;
var ie4=(document.all)? true:false;



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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
 
*/
function SubmitOnEnter(e,id)
{	
		var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
			
		if (keyCode == 13)
		{   	
			//__doPostBack(id,'');	
			Submit(id);
		}						
}
function Submit(id)
{	
	document.getElementById(id).value = "true";	
	document.Form1.submit();
	
}

function writeFlashBanner(id,src,width,height) {
  			
          document.getElementById(id).innerHTML = "<object data=\""+ src +"\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" type=\"application/x-shockwave-flash\" width='" + width +"' height='"+ height+ "' VIEWASTEXT><param name='allowScriptAccess' value='sameDomain' /><param name='movie' value='" + src +"' /><param name='quality' value='high' /><param name='bgcolor' value='#ffffff' /><embed src='" + src +"' quality='high' bgcolor='#ffffff' width='" +width+"' height='"+ height+"' name='mymovie' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></object>";
   
 }



/* scrol */
var scrollerwidth; 
var scrollerheight; 
var scrollerspeed;
var scrollercontent;
var pauseit=1; 	
var iedom=document.all||document.getElementById;
var actualheight='';
var cross_scroller, ns_scroller;
var pausespeed=(pauseit==0)? copyspeed: 0;

function populate(){ 

	if (iedom){ 
		cross_scroller=document.getElementById? document.getElementById("iescroller") : document.all.iescroller;
		//cross_scroller.style.top=parseInt(scrollerheight)+8+"px";
		cross_scroller.innerHTML=scrollercontent;
		actualheight=cross_scroller.offsetHeight;
	} else if (document.layers){ 
	
		ns_scroller=document.ns_scroller.document.ns_scroller2;
		//ns_scroller.top=parseInt(scrollerheight)+8;
		ns_scroller.document.write(scrollercontent);
		ns_scroller.document.close();
		actualheight=ns_scroller.document.height;
		
	} 
	lefttime=setInterval("scrollscroller()",20);
} 
function scrollscroller(){ 
	if (iedom){ 
		//alert("hej");
		if (parseInt(cross_scroller.style.top)>(actualheight*(-1)+8)) 
			cross_scroller.style.top=parseInt(cross_scroller.style.top)-copyspeed+"px";
		else cross_scroller.style.top=parseInt(scrollerheight)+8+"px"; 
	} 
	else if (document.layers){ 
		if (ns_scroller.top>(actualheight*(-1)+8)) ns_scroller.top-=copyspeed ;
		else ns_scroller.top=parseInt(scrollerheight)+8;
	} 
} 
function writeScroll(width,height,speed,htmlContent)
{
	// Distributed by http://www.hypergurl.com // Scrollers width here (in pixels) 
	// ex width = "100px", height = "100px", speed = 2
	scrollerwidth=width; // Scrollers height here 
	scrollerheight=height; 
	// Scrollers speed here (larger is faster 1-10) 
	scrollerspeed=speed;
	// Scrollers content goes here! Keep all of the message on the same line! 
	scrollercontent=htmlContent;
	pauseit=1; // Change nothing below! 
	scrollerspeed=(document.all)? scrollerspeed : Math.max(1, scrollerspeed-1); //slow speed down by 1 for NS var 
	copyspeed=scrollerspeed;
	iedom=document.all||document.getElementById;
	actualheight='';
	cross_scroller, ns_scroller;
	pausespeed=(pauseit==0)? copyspeed: 0;
	
	window.onload=populate;
	if (iedom||document.layers){ 
		with (document){ 
			if (iedom){ write('<div style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=scrollerspeed">');
						write('<div id="iescroller" style="position:absolute;left:0px;top:0px;width:100%;">');
						write('</div></div>'); } 
			else if (document.layers){ write('<ilayer width='+scrollerwidth+' height='+scrollerheight+' name="ns_scroller">');
										write('<layer name="ns_scroller2" width='+scrollerwidth+' height='+scrollerheight+'left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=scrollerspeed"></layer>');
										write('</ilayer>');
			} 
		} 
	} 
}

/*
var ie5=false;
if(document.compatMode && document.compatMode=='CSS1Compat')
{
	docRoot='document.documentElement';
	ie5=true;
}
else if((navigator.appVersion.indexOf("mac")!= -1 &&ie4) || (navigator.appVersion.indexOf("mac")!= -1 && ie5))
	 document.location = "http://www.gymnasieguiden.se/underconstruction.htm";
*/



/*
function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=300,height=400,left = 550,top = 325');");
}
*/
