// Set the horizontal and vertical position for the popup
var PositionX = 100;
var PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
var defaultWidth  = 700;
var defaultHeight = 700;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows
var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;var weight,height;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=150-(document.body.clientWidth-document.images[0].width);');
		writeln('height=150-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=ffffff scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<div style="text-align:center;vertical-align:middle"><img name="George" src='+imageURL+' style="display:block"></style></body></html>');
		close();		
	}
}

function load_blankimg(obj)
{
		//obj.src = "img/blankimg.gif";
}



function addEvent(objObject, strEventName, fnHandler) { 
	 // DOM-compliant way to add an event listener 
	if (objObject.addEventListener) 
	   objObject.addEventListener(strEventName, fnHandler, false); 
	// IE/windows way to add an event listener 
	else if (objObject.attachEvent) 
	   objObject.attachEvent("on" + strEventName, fnHandler); 
}
function getEventSrc(e) {
	if (!e) e = window.event;	
	if (e.target)
		return e.target;
	else if (e.srcElement)
		return e.srcElement;
}

function leftMenuOver(e)
{
	var el = getEventSrc(e);
	el.className = "NavMainBGon";
}
function leftMenuOut(e)
{
	var el = getEventSrc(e);
	el.className = "NavMainBGoff";
}
function init()
{
	var arrMenu = document.getElementsByTagName("TD");
	for (var e=0;e<arrMenu.length;e++)
	{
		if (arrMenu[e].className == "NavMainBGoff")
		{
			var curObj = arrMenu[e];
			addEvent(curObj,"mouseover",leftMenuOver);
			addEvent(curObj,"mouseout",leftMenuOut);
		}
	}
}
window.onload = init;


function showWaardePopup(URL,w,h,resize,scr,type) {
	l = (screen.availWidth-w) / 2;
	t = (screen.availHeight-h) / 2;
	window.open(URL + '?type='+type, "Mail", "height=" + h + ",width=" + w + ",top=" + t + ",left=" + l + ",toolbar=no,status=no,resizable=" + resize + ",scrollbars=" + scr +"");
}

function showImage(image){
	var obj = document.getElementById('mainImage')
	obj.style.backgroundImage = "url("+ image +")"
}

function preloader() { 
  var args = preloader.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++) {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

function loadYoutube(container, url) {
	document.getElementById(container).innerHTML = AC_FL_RunContent_youtube('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
		'width',304,
		'height',255,
		'align','left',
		'wmode','transparent',
		'FlashVars','required_version=8,0,24,0',
		'src',url,
		'quality','high',
		'bgcolor','#ffffff',
		'name',url,
		'allowscriptaccess','sameDomain',
		'pluginspage','http://www.macromedia.com/go/getflashplayer',
		'movie',url + '&rel=0');
}

function display(id,arr) {
	if(arr!=undefined) {
		var a = arr.split(',')
		for(i=0;i<a.length;i++){
			if(document.getElementById(a[i])) document.getElementById(a[i]).style.display='none'
		}
	}
	if(id!=''){
		if(document.getElementById(id)){
			var obj = document.getElementById(id).style
			if(obj.display=='none'){
				obj.display='block'
			}
		}
	}
	return false
}
