
/* SIMPLE ONLOAD HANDLER */
function addEvent(obj, evType, fn)
	{ 
 		if (obj.addEventListener)
			{ 
   				obj.addEventListener(evType, fn, false); 
   				return true; 
 			} 
		else if (obj.attachEvent)
			{ 
   				var r = obj.attachEvent("on"+evType, fn); 
   				return r; 
 			} 
		else 
			{ 
   				return false; 
 			}	 
	}
// ADD ONLOAD EVENTS
// addEvent(window, 'load', getvarurl);
/* END ONLOAD HANDLER */

/* FEEDBACK */
function feedback(message)
	{
		Effect.BlindDown('feedback');
	}
/* END FEEDBACK*/

/* RUNS ONLOAD - USED IN MVT TO LOAD THE FORM INTO THE DIV WHEN THE VARIANT WITH EXTENDE FORM IS SERVER */
function check_quickform_mvt(section,redirect_to_menu)
	{
		var section=section;
		var redirect_to_menu=redirect_to_menu;
		var form_div = document.getElementById("return_call_form");
		// IF THE FORM IS SET TO DISPLAY, GET THE CONTENTS OF THE DIV
		if(form_div.style.display=="block")
				{
					change('quick_form','en','int','return_call',''+section+'',redirect_to_menu,0);
				}
	}
/* END MVT */

/* LANGUAGE SWITCH */
function language_switch(current,direction)
	{
		var language_div = document.getElementById("language_div"); 
		var language_link = document.getElementById("language_link_top"); 
		var language_link_flag = document.getElementById("language_link_flag"); 
		
		if(direction=="out")
			{
				language_div.style.display = "block";
				//$('language_div').appear({duration: 0.8, to: 0.8 });
				language_link.setAttribute("href", "javascript:language_switch('"+current+"','in');");
				language_link_flag.setAttribute("href", "javascript:language_switch('"+current+"','in');");
			}
			
		if(direction=="in")
			{
				language_div.style.display = "none";
				//$('language_div').fade({duration: 0.8});
				language_link.setAttribute("href", "javascript:language_switch('"+current+"','out');");
				language_link_flag.setAttribute("href", "javascript:language_switch('"+current+"','out');");
			}			
	}
/* END LANGUAGE SWITCH */	


/* PARTNERLOGO SWITCH */
function partner_logo_switch(cat)
	{
		var partner_div = document.getElementById("partner_"+cat+"_wrapper"); 
		var partner_div_icon = document.getElementById("partner_logo_foldout_"+cat);
		
		// IN ORDER TO NOT HAVE TROUBLE WITH THE Z-INDEX, CHANGE CLASSES OF OTHER FOLDOUT ICONS
		var other_foldouts = document.getElementById("wrapper_2_column_6040").getElementsByTagName("div");

		
		if(partner_div.style.display!="block" && partner_div.style.display!="")
			{
				for(var i=0; i<other_foldouts.length; i++){
				if(other_foldouts[i].className == "partner_logo_foldout" ){
						other_foldouts[i].className="partner_logo_foldout_inactive";	
					}
				}				
				// $('partner_'+cat+'_wrapper').appear({duration: 0.5});
				// Effect.Grow('partner_'+cat+'_wrapper',{direction:'top-right'});
				Effect.BlindDown('partner_'+cat+'_wrapper');
				partner_div_icon.className="partner_logo_close";
				
			}
		else
			{
				for(var i=0; i<other_foldouts.length; i++){
				if(other_foldouts[i].className == "partner_logo_foldout" ){
						other_foldouts[i].className="partner_logo_foldout";	
					}
				}					
				// partner_div.style.display = "none";
				Effect.BlindUp('partner_'+cat+'_wrapper');
				partner_div_icon.className="partner_logo_foldout";
				// $('partner_'+cat+'_wrapper').hide({duration: 0.8});
			}

	}
/* END LANGUAGE SWITCH */	



/* JAVASCRIPT ANCHOR LINK */
function move_to_anchor(anchor)
	{
		var anchor_div=document.getElementById(anchor);
		if(anchor_div!=null){Effect.ScrollTo(anchor); return false;
		//window.location.hash=anchor;
		}
		//else{alert('anchor bestaat nog niet');}
		return false;
	}
/* END JAVASCRIPT ANCHOR LINK */


/* ONLOAD CHECK URL EVENT */
function getvarurl(lang,site)
	{
		// load the URL into a variable
	   	var url = window.location.href;
		var site= site;
		var lang= lang;
	
	   	// split the url by ?
	   	var qparts = url.split("?");
	 	if(qparts[1].indexOf("play_segmentation")>0)
			{
				enlarge('http://www.nedstat.com/streaming/segmentation_'+lang+'.swf?id=1',''+site+'',''+site+'.solutions.segmentation.screencast','event','video',815,645);
			}
	}
/* ONLOAD CHECK URL EVENT */


/* REDIRECT + CLICKOUT MEASUREMENT FOR LOGIN */
function redirect(site)
	{
		window.location=site;
	}
	
/* REDIRECTS FOR SITESTAT AND DIRECT VIEW LOGIN	*/
function redirectx(site)
	{
		if(site=="befr" || site=="benl"){site="be";}		
		var w = 1012;
		var h = screen.height - 72;
		var settings = 'width=' + w + ',height=' + h + ',top=0,left=0,toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=1';
		var newWindow = window.open("http://nl.sitestat.com/nedstat/"+site+"/s?"+site+".login.sitestat_gui&ns_type=clickout&ns_url=[http://siteview.nedstat.nl/html/index.html]", '_blank',  settings);
		if (newWindow) newWindow.focus();
	}
	
function redirecty(site)
	{
		if(site=="befr" || site=="benl"){site="be";}
		var w=screen.width;
		var h=screen.height - 72;
		var settings = 'width=' + w + ',height=' + h + ',top=0,left=0,toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=1';
		var dvWindow = window.open("http://nl.sitestat.com/nedstat/"+site+"/s?"+site+".login.sitestat_direct_view&ns_type=clickout&ns_url=[http://directview.sitestat.com/ui.htm]", '_blank',  settings);
		if (dvWindow) dvWindow.focus();
	}
redirectz = function (site)
	{
		if(site=="befr" || site=="benl"){site="be";}
		var w = screen.width;
		var h=screen.height - 72;
		var settings = 'width=' + w + ',height=' + h + ',top=0,left=0,toolbar=0,scrollbars=1,location=0,statusbar=0,status=0,menubar=0,resizable=1';
		var newWindow = window.open("http://nl.sitestat.com/nedstat/"+site+"/s?"+site+".login.sitestat_report_builder&ns_type=clickout&ns_url=[http://siteview.nedstat.nl/html/reportbuilder/index.html]", '_blank',  settings);
		if (newWindow) newWindow.focus();
	}
	
/* END REDIRECT FOR LOGIN */

/* SIMPLE REDIRECT + CLICKOUT THROUGH SELECT BOX */
function dropdown(site)
	{
		var redirect_to = document.forms.form.proredirect.value;
		var w = 1012;
		var h = screen.height - 72;
		var settings = 'width=' + w + ',height=' + h + ',top=0,left=0,toolbar=1,scrollbars=1,location=0,statusbar=1,status=1,menubar=1,resizable=1';
		var newWindow = window.open("http://nl.sitestat.com/nedstat/"+site+"/s?"+site+".login.nedstat_pro&ns_type=clickout&ns_url=["+redirect_to+"]", '_blank',  settings);
						
		if(redirect_to)
			{	
				if (newWindow) newWindow.focus();				
			}
			return false;
	}
/* END SIMPLE REDIRECT THROUGH SELECT BOX */




/* CHECK IF IN ARRAY */
Array.prototype.inArray = function (value,caseSensitive)
	{
		var i;
		for (i=0; i < this.length; i++) 
			{
				// use === to check for Matches. ie., identical (===),
				if(caseSensitive)
					{ //performs match even the string is case sensitive
						if (this[i].toLowerCase() == value.toLowerCase()) {	return true;}
					}
				else
					{
						if (this[i] == value) 
							{
								return true;
							}
					}
			}
		return false;
	};
/* CHECK IF IN ARRAY */



/*	FORM MEASUREMENT SCRIPT */	
	function validate_form(form,language,mandatory) 
		{
		var lang = language;
		var isValid = true;
		try {
			
			/*
			check for numbers
			if(!/^[0-9][0-9\.]+$/.test(form.phone.value)
			
			//check for checkboxes
			if(!(form.name2.checked || form.name3.checked || form.name4.checked)) {
				throw ({fields : ["name2"], message : "Please specify a location"});
			}
			*/
			
			//check for checkboxes
			/*
			if(eval(form.name2) && eval(form.name3) && eval(form.name4))
				{
					
					if(!(form.name2.checked || form.name3.checked || form.name4.checked)) 
					{
						if(lang=="en")
						{							
							throw ({fields : ["name2"], message : "Please specify a location"});
						}
					}
				}
			*/
			
			
			
			//check for radio button
			if(document.AdhocForm.location)
				{
					/*
					if (document.AdhocForm.name2[0]) 
						{ // if the button group is an array (one button is not an array)
						//alert('asdfa');
							for (var i=0; i<document.AdhocForm.name2.length; i++) {
								 if (document.AdhocForm.name2[i].checked) 
									{
										alert( i );
									}
						}
					*/
					if(mandatory.inArray('location') && !(document.AdhocForm.location[0].checked || document.AdhocForm.location[1].checked || document.AdhocForm.location[2].checked)) 
					{
						if(lang=="en")
							{							
								throw ({fields : ["location"], message : "Please specify a location"});
							}
						if(lang=="de")
							{							
								throw ({fields : ["location"], message : "Wahlen Sie bitte eine Veranstaltung aus"});
							}						
					}
					
				}				

	
			if(mandatory.inArray('name') && document.AdhocForm.name && document.AdhocForm.name.value.length==0) {
				if(lang=="en")
					{
						throw ({fields : ["name"], message : "Please enter your name"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["name"], message : "Vul alstublieft uw naam in"});
					}				
				else if (lang=="de")	
					{
						throw ({fields : ["name"], message : "Bitte geben Sie Ihren Namen ein"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["name"], message : "Donnez votre nom, s'il vous plaît"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["name"], message : "Por favor, introduzca su nombre"});
					}				
				}			


			if (mandatory.inArray('name1') && document.AdhocForm.name1 && document.AdhocForm.name1.value.length==0){

				if (lang=="es")	
					{
						throw ({fields : ["name1"], message : "Por favor, introduzca sus apellidos"});
					}				
				}



			if(mandatory.inArray('company') && document.AdhocForm.company && document.AdhocForm.company.value.length==0) {
			
				if(lang=="en")
					{
						throw ({fields : ["company"], message : "Please enter the name of your company"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["company"], message : "Vul alstublieft de naam van uw bedrijf in"});
					}				
				else if (lang=="de")	
					{
						throw ({fields : ["company"], message : "Bitte geben Sie den Namen Ihres Unternehmens ein"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["company"], message : "Donnez nom d'enterprise, s\'il vous plaît"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["company"], message : "Por favor, introduzca el nombre de su compa&ntilde;&iacute;a"});
					}				
				}

			
			if(mandatory.inArray('functions') && document.AdhocForm.functions && document.AdhocForm.functions.value.length==0) {
				if(lang=="en")
					{
						throw ({fields : ["functions"], message : "Please enter your jobtitle"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["functions"], message : "Vul alstublieft uw functie in"});
					}				
				else if (lang=="de")	
					{
						throw ({fields : ["functions"], message : "Bitte geben Sie Ihre Position ein"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["functions"], message : "Donnez nom de fonction, s\'il vous plaît"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["functions"], message : "Por favor, introduzca su cargo"});
					}				
				}


			if(mandatory.inArray('phone') && document.AdhocForm.phone && document.AdhocForm.phone.value.length==0) {
				if(lang=="en")
					{
						throw ({fields : ["phone"], message : "Please enter your phone number"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["phone"], message : "Vul alstublieft uw telefoonnummer in"});
					}				
				else if (lang=="de")	
					{
						throw ({fields : ["phone"], message : "Bitte geben Sie Ihre Telefonnummer ein"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["phone"], message : "Donnez le num&eacute;ro de t&eacute;l&eacute;phone, s\'il vous plaît"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["phone"], message : "Por favor, introduzca su número de tel&eacute;fono"});
					}												
				}



			if(mandatory.inArray('email') && document.AdhocForm.email && !/@/.test(document.AdhocForm.email.value)){
				if(lang=="en")
					{
						throw ({fields : ["email"], message : "Please enter a valid e-mail address"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["email"], message : "Vul alstublieft een geldig E-Mail adres in"});
					}	
				else if (lang=="de")	
					{
						throw ({fields : ["email"], message : "Bitte geben Sie Ihre E-Mail-Adresse ein"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["email"], message : "Donnez votre adresse email, s\'il vous plaît"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["email"], message : "Por favor, introduzca su dirección de e-mail"});
					}	
				}



			//check for URL
			if(mandatory.inArray('url') && document.AdhocForm.url && document.AdhocForm.url.value.length==0) {
				if(lang=="en")
					{
						throw ({fields : ["url"], message : "Please enter the URL of your website"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["url"], message : "Vul alstublieft het adres van uw website in"});
					}				
				else if (lang=="de")	
					{
						throw ({fields : ["url"], message : "Bitte geben Sie die URL Ihrer Website ein"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["url"], message : "Donnez l\'adresse de site web, s\'il vous plaît"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["url"], message : "Por favor, introduzca la dirección URL de su sitio web"});
					}												
				}



			//check for approve checkbox
			if(mandatory.inArray('terms') && document.AdhocForm.terms && !(document.AdhocForm.terms.checked)) {
				if(lang=="en")
					{
						throw ({fields : ["terms"], message : "You have to accept the terms and conditions of Nedstat Academy"});
					}
				else if (lang=="nl")	
					{
						throw ({fields : ["terms"], message : "Om deel te kunnen nemen aan de trainingen en workshops dient u akkoord te gaan met de voorwaarden"});
					}				
				else if (lang=="de")	
					{
						throw ({fields : ["terms"], message : "Bitte stimmen Sie den Teilnahmebedingungen zu"});
					}
				else if (lang=="fr")	
					{
						throw ({fields : ["terms"], message : "Avant de compléter votre inscription, prière d\'indiquer votre acceptation des conditions"});
					}
				else if (lang=="es")	
					{
						throw ({fields : ["terms"], message : "Usted ha aceptado los t&eacute;rminos y condiciones de Nedstat Academy"});
					}	
			}

			
		} catch (e) {
			ns_API.forms.dispatchValidationError(document.AdhocForm,e.fields.join(","),e.message, "*","*","*");	
			alert(e.message);
			focus(e.fields);
			isValid = false;
			
		} finally {
			return isValid;
		}
	};
	
function focus(where)
	{
		document.getElementById(where).focus();
		//AdhocForm.where.focus();	
	}
/* END FORM MEASUREMENT SCRIPT */	




/* START MULTIPURPOSE CHANGE SCRIPT */
var xmlHttp
var action
var cat_number

function change(to_do,str,str1,str2,str3,str4,str5)
	{ 
		// SET VARS
		url="http://"+location.hostname+"/";
		xmlHttp=GetXmlHttpObject()
		action=to_do

		if (xmlHttp==null)
			 {
				 alert ("Browser does not support HTTP Request")
				 return
			 }


 		// FOR DISPLAYING CUSTOMER LOGOS
		if (action=='shift_customer_logos')
			{
				//create the url that you need to open
				document.getElementById("customer_logos").style.display="none";
				url=url+"/includes/php/act_customer_rotate.php"
				url=url+"?sid="+Math.random()
			}

 		// FOR DISPLAYING PARTNER LOGOS
		else if (action=='shift_partner_logos')
			{
				direction=str
				start=str1
				cat=str2
				total=str3	
				site=str4
				
				//create the url that you need to open
				document.getElementById("partner_logos_"+cat).style.display="none";
				url=url+"includes/php/act_partner_rotate.php"
				url=url+"?direction="+str
				url=url+"&start="+str1
				url=url+"&cat="+str2
				url=url+"&total="+str3
				url=url+"&site="+str4
				url=url+"&sid="+Math.random()
			}

		// FOR SHORT FORM IN CALL TO ACTION
		else if (action=='quick_form')
			{
				language=str
				site=str1
				form=str2
				section=str3
				redirect_to_menu=str4
				countername=language+"."+section+".call_to_action.form";
				// str5 is used to know whether the cursor should focus on the first field the form, 0=no focus
				if(str5==0){focussed=0;}else{focussed=1;}
				
				//create the url that you need to open
				url=url+"includes/php/dsp_quickform.php"
				url=url+"?site="+site
				url=url+"&language="+language
				url=url+"&form="+form
				url=url+"&section="+section
				url=url+"&redirect_to_menu="+redirect_to_menu
				url=url+"&sid="+Math.random()
			}

xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}


function stateChanged() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			if (action=='shift_customer_logos')
				{	
					document.getElementById("customer_logos").innerHTML=xmlHttp.responseText;
					setTimeout("change('shift_customer_logos')",6000);
					$('customer_logos').appear();
				}
				
			else if (action=='shift_partner_logos')
				{	
					prev=start-1;
					if(prev<0){prev=total-1;}
					next=start+1;
					if(next>=total){next=0;}
					
					var link_previous = document.getElementById("partner_logos_prev_"+cat);
					var link_next = document.getElementById("partner_logos_next_"+cat);
	
					// DON'T USE SET ATTRIBUTE, IE WON'T HAVE IT IN COMBINATION WITH ONCLICK
					link_previous.onclick=new Function("change('shift_partner_logos','prev',"+ prev +","+cat+","+total+",'"+site+"')");
					link_next.onclick=new Function("change('shift_partner_logos','next',"+ next +","+cat+","+total+",'"+site+"')");

					document.getElementById("partner_logos_"+cat).innerHTML=xmlHttp.responseText;
					//new Effect.Opacity('customer_logos', { from: 0, to: 1});
					$('partner_logos_'+cat).appear();

				}				
			else if(action=='quick_form')
				{
					form_div=document.getElementById("return_call_form");
					form_div_parent=document.getElementById("action_call_return");
					
					// IF NOT VISIBLE, EXPAND, "FOCUSSED" IS ONLY FOR THE MVT EXPERIMENT
					if(form_div.style.display=="none" || form_div.style.display=="" || focussed==0)
						{
							form_div.style.display="block";

							// SET NEW CSS CLASS
							form_div.className="return_call_form_open";
		
							// SET BACKGROUND OF PARENT DIV
							form_div_parent.className="return_call_form_active";

							// PLACE HTML
							form_div.innerHTML=xmlHttp.responseText;
							
							// FOCUS ON FIRST FIELD
							if(focussed==1)
								{document.getElementById("name").focus();}
						}
					// IF VISIBLE, COLLAPS	
					else
						{
							// RESET CLASS OF THE FORM
							form_div.className="return_call_form";
							// RESET CLASS OF PARENT DIV
							form_div_parent.className="action_item";
							form_div.style.display="none";
						}
				}

			else
				{
					alert('no action defined');	
				}

	}
//END MULTIPURPOSE CHANGE SCRIPT


//AJAX BROWSER CHECK
function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
	 		{
				// Firefox, Opera 8.0+, Safari
				xmlHttp=new XMLHttpRequest();
			 }

		catch (e)
 			{
				//Internet Explorer
				 try
					  {
					  	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
					  }

						 catch (e)
						  {
						  	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
						  }
			 }
	return xmlHttp;
	}

// END AJAX browsercheck



//SCRIPT FOR LAYOVERS WITH IMAGES AND VIDEOS, INCLUDES MEASUREMENT
var ie=document.all
var ns6=document.getElementById&&!document.all

function ietruebody()
	{
		return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
	}

function enlarge(which, country, counter_name, e, type, imgwidth, imgheight, extra, flashvars)
	{
		if(country=="uk")
			{
				var message_close="close";
				var message_image="Click to close the screenshot";
			}
		else if(country=="nl")
			{
				var message_close="sluiten";
				var message_image="Klik op het screenshot om het te sluiten";
			}
		else if(country=="de")
			{
				var message_close="schlie&szlig;en";
				var message_image="Klicken Sie um der Screenshot zu schlie&szlig;en";
			}			
		else if(country=="es")
			{
				var message_close="cerrar";
				var message_image="Click to close the screenshot";
			}
		else
			{
				var message_close="close";
				var message_image="Click to close the screenshot";
			}

		if (ie||ns6)
			{
				crossobj=document.getElementById("showimage");
	
				// STRETCH SEMI TRANSPARENT OVERLAY TO COVER THE PAGE
				// USE getPageSize, returns pageWidth,pageHeight,windowWidth,windowHeight
				// USE THE PAGEWIDTH AND PAGEHEIGHT FOR THE OVERLAY
				// USE WINDOWWIDTH AND WINDOWHEIGHT TO POSITION THE DIV WITH CONTENTS
 				var arrayPageSize = this.getPageSize();
 												
				document.getElementById("background_overlay").style.display="block";				
				document.getElementById("background_overlay").style.width=arrayPageSize[0] + "px";
				document.getElementById("background_overlay").style.height=arrayPageSize[1] + "px";
				//new Effect.Appear('background_overlay', { from: 0, to: 0.7, duration: 0.5 });
				
				//SET SIZE OF NEW DIV
				var divwidth= imgwidth + 30;
				var divheight= imgheight + 20;

				// SET POSITION OF IMAGE
				var horzpos=Math.round((arrayPageSize[2]/2)-(divwidth/2));
				// GET Y OFFSET, HOW MUCH WAS SCROLLED DOWN, USE IT TO CALCULATE VERTICAL POSITION OF IMAGE
				var pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
				var vertpos=Math.round((pgyoffset+arrayPageSize[3]/2)-(divheight/2));

				
				crossobj.style.left=horzpos+"px"
				crossobj.style.top=vertpos+"px"
				crossobj.style.height=divheight+"px";
				crossobj.style.width=imgwidth+"px";
				
				if(type=="image")
					{
						crossobj.innerHTML='<div id="dragbar" style="width:'+imgwidth+'px;"><a href="javascript:closepreview()"><img src="/images/icons/close.png" class="screenshot_close" border=0></a></div>';
						crossobj.innerHTML+='<div id="screenshot"><a href="javascript:closepreview();" title="'+message_image+'"><img border=0 src="'+which+'" width="'+imgwidth+'" height="'+imgheight+'" alt="'+message_image+'"></a></div>';
					}
				else if(type="video")
					{
						// EXCEPTION FOR BRIGHTCOVE
						var base;
						if(extra=="brightcove")
							{
								base="http://admin.brightcove.com/viewer/";
							}
						crossobj.innerHTML='<div id="dragbar" style="width:'+imgwidth+'px;"><a href="javascript:closepreview()"><img src="/images/icons/close.png" class="screenshot_close" border=0></a></div>';
						crossobj.innerHTML+='<div id="screenshot"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+imgwidth+'" height="'+imgheight+'" id="flashObj" align="middle"><param name="flashVars" value="'+flashvars+'"/><param name="movie" value="'+which+'"/><param name="allowScriptAccess" value="always"/><param name="base" value="'+base+'"/><param name="SeamlessTabbing" value="false"/><param name="quality" value="high" /><param name="bgcolor" value="#ffffff"/><param name="wmode" value="transparent"/><embed src="'+which+'" bgcolor="#FFFFFF" flashVars="'+flashvars+'" base="'+base+'" name="flashObj" width="'+imgwidth+'" height="'+imgheight+'" seamlesstabbing="false" type="application/x-shockwave-flash" allowFullScreen="true" swLiveConnect="true" allowScriptAccess="always" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></object></div>';
					}
				else
					{
						crossobj.innerHTML='<div id="dragbar" style="width:'+imgwidth+'px;"><a href="javascript:closepreview()">'+message_close+'</a></div>';
						crossobj.innerHTML+='<div id="screenshot"><a href="javascript:closepreview();" title="'+message_image+'"><img border=0 src="'+which+'" width="'+imgwidth+'" height="'+imgheight+'" alt="'+message_image+'"></a></div>';
					}					
			
			// AND DISPLAY
			crossobj.style.display="block";
			
			/* SITESTAT MEASUREMENT */
			sitestat("http://nl.sitestat.com/nedstat/"+country+"/s?"+counter_name+"");
			return false
			}

		//if NOT IE 4+ or NS 6+, simply display image in full browser window
		else 
		return true
	}

		
 function closepreview(e)
	 {
		crossobj.style.display="none";
		/*background_overlay=document.getElementById("background_overlay"); */
		document.getElementById("background_overlay").style.display="none";
		
	 }


function drag_drop(e)
 	{
		 if (ie&&dragapproved)
			{
				 crossobj.style.left=tempx+event.clientX-offsetx+"px"
				 crossobj.style.top=tempy+event.clientY-offsety+"px"
			 }
		 else if (ns6&&dragapproved)
			{
				 crossobj.style.left=tempx+e.clientX-offsetx+"px"
				 crossobj.style.top=tempy+e.clientY-offsety+"px"
			 }
		 return false
 	}


function initializedrag(e)
 	{
		 if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar")
			 {
				 offsetx=ie? event.clientX : e.clientX
				 offsety=ie? event.clientY : e.clientY
				 tempx=parseInt(crossobj.style.left)
				 tempy=parseInt(crossobj.style.top)
				 dragapproved=true
				 document.onmousemove=drag_drop
			 }
 	}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")
//document.ondblclick=closepreview;


// COPIED FROM LIGHTBOX
function getPageSize() 
 	{

	 	var xScroll, yScroll;

		 if (window.innerHeight && window.scrollMaxY) 
			{
				 xScroll = window.innerWidth + window.scrollMaxX;
				 yScroll = window.innerHeight + window.scrollMaxY;
			} 

		else if (document.body.scrollHeight > document.body.offsetHeight)
			{ // all but Explorer Mac
				 xScroll = document.body.scrollWidth;
				 yScroll = document.body.scrollHeight;
			} 

		else 
			{ // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}

 		var windowWidth, windowHeight;

		if (self.innerHeight) 
			{ // all except Explorer
				if(document.documentElement.clientWidth)
					{
						 windowWidth = document.documentElement.clientWidth;
					 } 
				else 
					{
						 windowWidth = self.innerWidth;
					 }
		 
				windowHeight = self.innerHeight;
			} 
		else if (document.documentElement && document.documentElement.clientHeight) 
			{ // Explorer 6 Strict Mode
				 windowWidth = document.documentElement.clientWidth;
				 windowHeight = document.documentElement.clientHeight;
			 } 
		else if (document.body) 
			{ // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}

		 // for small pages with total height less then height of the viewport
		 if(yScroll < windowHeight)
			{
				pageHeight = windowHeight;
			} 
		else 
			{
				pageHeight = yScroll;
			}

		 // for small pages with total width less then width of the viewport
		 if(xScroll < windowWidth)
			{
				pageWidth = xScroll;
			} 
		else 
			{
				pageWidth = windowWidth;
			}

 	return [pageWidth,pageHeight,windowWidth,windowHeight];
 }
//SCRIPT FOR LAYOVERS WITH IMAGES AND VIDEOS, INCLUDES MEASUREMENT