var ID = null;
var vorN = "NULL";
var myObject,preloadArray;
var imPrfx="~";

function onof(L,N,f) {
	if (N == 1 && f == 1){ L.className = "onM1";}
	else if (N == 2 && f == 1) {L.classname="onM" ;}
		else if (N == 1 && f == 0){L.className = "ofM1";}
			else if (N == 2 && f == 0) {L.classname="ofM" ;}
}

function f_tog(n,o){
var aN = document.getElementsByTagName("select");
var aL = aN.length;
	for(i=0; i < aL; i ++){
	       c = aN[i].id.charAt(n);
			if (n == c && o == 0) {aN[i].style.visibility = "hidden";}
			else if (n==c && o==1) {aN[i].style.visibility = "visible";}
	}
}

function mm_ct(name,o) {
	if (document.getElementById) {
		nL=name.length;
		nC = name.charAt(nL-1);
		var boxN = document.getElementById(name);


		var vorboxN = document.getElementById(vorN);

		if (o == 1) {
			if (vorboxN){
			var pnL=vorboxN.id.length;
			var pnC = vorboxN.id.charAt(pnL-1);
			vorboxN.style.visibility = "hidden";
			f_tog(pnC,1);
			}
		f_tog(nC,0);
		boxN.style.visibility = "visible";
		vorN = name;
		} else if (o == 0) {

			f_tog(nC,1);
			if (boxN) {
			boxN.style.visibility = "hidden";
			}
		}
	}
}

function Dropdown(id, bShow, bHideSelects)
{
	var obj = document.getElementById(id);
	if (!obj || !obj.style)
		return;
	nL=id.length;
	nC = id.charAt(nL-1);
	if (bShow==1) {
		var pnL=id.length;
		var pnC = id.charAt(pnL-1);
		f_tog(pnC,0);
		obj.style.visibility = "visible";
	} else {
		f_tog(nC,1);
		obj.style.visibility = "hidden";
	}

}

function go(urLL,target,w,h) {
	if (target == 1) {
		if (w>0 && h>0) {
			window.open(urLL,'AutoWeekpopup','toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,menubar=no,width='+w+',height='+h+',left=0,top=0');
		} else {
			window.open(urLL,'AutoWeekpopup','toolbar=no,location=no,resizable=no,status=no,scrollbars=no,menubar=no,width=794,height=550,left=0,top=0');
		}
	} else {
		window.location = urLL;
	}
}

function makeHttpRequest(url) {
       if (window.XMLHttpRequest) { // Mozilla, Safari,... 
           http_request = new XMLHttpRequest(); 
       } else if (window.ActiveXObject) { // IE 
           http_request = new ActiveXObject("Microsoft.XMLHTTP"); 
       } 
       http_request.open('GET', url, true); 
       http_request.send(null); 
}


function popup2(naam,winnaam,winwidth,winheight,winscroll){
var tmpWin2 = null;
	var myScrollBarOffset = 12;
	var newnaam = naam;
	var h = winheight+20;
	startDate= new Date();
	if (tmpWin2 == null || tmpWin2.closed) {
		 	if(parseInt(navigator.appVersion)>=4){
		 		tmpWin2=window.open(newnaam,winnaam,"toolbar=no,location=no,resizable=no,status=no,scrollbars="+winscroll+",menubar=no,width="+
		 		(winwidth-myScrollBarOffset)+",height="+h+",left=0,top=0");}
		 	else{tmpWin2=window.open(newnaam,winnaam,"toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,menubar=no,width=404,height=380");}
			tmpWin2.location.href = newnaam;
			if (tmpWin2.opener == null) tmpWin2.opener = self;
			if (navigator.appName != "Microsoft Internet Explorer" || parseInt(navigator.appVersion) >=5)
				tmpWin2.focus();
	}
	else {
			if (navigator.appName != "Microsoft Internet Explorer" || parseInt(navigator.appVersion) >=5)
				tmpWin2.focus();
	}
}

function getCookie(name) {
 var dc = document.cookie;
 var prefix = name + "=";
 var begin = dc.indexOf("; " + prefix);
 if (begin == -1) {
   begin = dc.indexOf(prefix);
   if (begin != 0) return null;
 } else
   begin += 2;
 var end = document.cookie.indexOf(";", begin);
 if (end == -1)
   end = dc.length;
 return unescape(dc.substring(begin + prefix.length, end));
}


function checkatt() {
 var seen = getCookie("ATT2008popup"); 
 if (!seen) {
 popup2('http://www.autoweek.nl/att2008.php?popup=1&cache=no','ATT',760,600,1);
 }
}
