// JavaScript Document
function open_URL(URL)
{
	var scherm_width = (screen.availWidth);
	var scherm_heigth = (screen.availHeight);
	var openscherm = window.open(URL,"_blank","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=" + scherm_width + "px,height=" + scherm_heigth + "px,left=0px,top=0px");
	openschermerrorcheck(openscherm);
}

function open_URLtitel(URL,titel)
{
	titel = titel.replace(/&/g,"%26");
	var scherm_width = (screen.availWidth - 30);
	var scherm_heigth = (screen.availHeight - 50);
	var openscherm = window.open(URL+"?title="+titel,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + scherm_width + "px,height=" + scherm_heigth + "px,left=10px,top=10px");
	openschermerrorcheck(openscherm);
}

function open_URLartikel(URL,titel)
{
	titel = titel.replace(/&/g,"%26");
	var scherm_width = 800;
	var scherm_heigth = 600;
	var openscherm = window.open(URL+"?title="+titel,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + scherm_width + "px,height=" + scherm_heigth + "px,left=10px,top=10px");
	openschermerrorcheck(openscherm);
}

function open_URLJobs(URL,titel)
{
	titel = titel.replace(/&/g,"%26");
	var scherm_width = 800;
	var scherm_heigth = 768;
	var openscherm = window.open(URL+"?title="+titel,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + scherm_width + "px,height=" + scherm_heigth + "px,left=10px,top=10px");
	openschermerrorcheck(openscherm);
}

function open_kantoor(URL,titel)
{
	titel = titel.replace(/&/g,"%26");
	var scherm_width = 700;
	var scherm_heigth = 500;
	var openscherm = window.open(URL+"?title="+titel,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + scherm_width + "px,height=" + scherm_heigth + "px,left=10px,top=10px");
	openschermerrorcheck(openscherm);
}

function open_pdf(pdf,naam)
{
	naam = naam.replace(/&/g,"%26");
	var scherm_width = (screen.availWidth - 30);
	var scherm_heigth = (screen.availHeight - 50);
	var openscherm = window.open("/nl/pdf_viewer.php?file="+pdf+"&naam="+naam,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + scherm_width + ",height=" + scherm_heigth + ",left=10,top=10");
	openschermerrorcheck(openscherm);
}

function open_foto(bestand,naam)
{
	naam = naam.replace("&","%26");
	var scherm_width = (screen.availWidth - 30);
	var scherm_heigth = (screen.availHeight - 50);
	var openscherm = window.open("/nl/image_viewer.php?file=" +bestand +"&naam="+naam,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + scherm_width + ",height=" + scherm_heigth + ",left=10,top=10");
	openschermerrorcheck(openscherm);
}
function openschermerrorcheck(err)
{
	if (err == null)
	{
		var bovenpixels = 0;
		var linkspixels = 0;
		var x = document.body;
		//hoogte - breedte van het scherm
			var a,b;
			if (self.innerHeight) // all except Explorer
			{
				a = self.innerWidth;
				b = self.innerHeight;
			}
			else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
			{
				a = document.documentElement.clientWidth;
				b = document.documentElement.clientHeight;
			}
			else if (document.body) // other Explorers
			{
				a = document.body.clientWidth;
				b = document.body.clientHeight;
			}
		//scroll positie
			var c,d;
			if (self.pageYOffset) // all except Explorer
			{
				c = self.pageXOffset;
				d = self.pageYOffset;
			}
			else if (document.documentElement && document.documentElement.scrollTop)// Explorer 6 Strict
			{
				c = document.documentElement.scrollLeft;
				d = document.documentElement.scrollTop;
			}
			else if (document.body) // all other Explorers
			{
				c = document.body.scrollLeft;
				d = document.body.scrollTop;
			}
			bovenpixels = Math.round((b / 2) + (d - 175));
			linkspixels = Math.round(((a / 2) - 175) + c);
		
		if (!document.getElementById("popupblockertekst"))
		{
			divinsert = "<div id=\"popupblockertekst\" style=\"z-index:10;position:absolute;top:"+bovenpixels+"px;left:"+linkspixels+"px;height:350px;width:350px;background-color:#E60028;color:#FFFFFF;font-weight:bold;display:block;vertical-align:middle;font-size:14px;\">\n";
			divinsert += "	<div style=\"font-size:10px;text-align:right;position:absolute;right:2px;top:2px;\"><a href=\"javascript:close_popupblock()\" style=\"color:#FFFFFF;\">Sluiten</a></div>\n";
			divinsert += "	<p align=\"center\" style=\"padding-top:100px;vertical-align:middle;font-size:14px;padding-left:10px;padding-right:10px;\">\n";
			divinsert += "		De door u gevraagde pagina kan niet worden weergegeven omdat uw programma het openen van nieuwe vensters verhindert (\"pop-up blocker\").<br />\n";
			divinsert += "		<br /><br />\n";
			divinsert += "		Gelieve de instellingen van uw programma te wijzigen zodat nieuwe vensters van deze website worden toegelaten.\n";
			divinsert += "	</p>\n";
			divinsert += "</div>\n";
			x.innerHTML += divinsert;
		}
		else
		{
			document.getElementById("popupblockertekst").style.top = bovenpixels +"px";
			document.getElementById("popupblockertekst").style.display = "block";
		}
	}
	else
	{
		if(!err.parent)
		{
			err = null;
			openschermerrorcheck(err);
		}
	}
}
function close_popupblock()
{
	document.getElementById("popupblockertekst").style.display = "none";
}
function sendmail(persoon)
{
	mailto = "mailto:" +persoon +"@sgpriv.be";
	window.location = mailto;
}
function clientregl(persoon)
{
window.location = ("mailto:" + persoon + "@sgpriv.be?subject=Aanvraag cliëntenreglement&cc=helpdesk@sgpriv.be&body= ");
}
function spaarregl(persoon)
{
window.location = ("mailto:" + persoon + "@sgpriv.be?subject=Aanvraag spaarrekeningreglement&cc=helpdesk@sgpriv.be&body= ");
}

function MM_jumpMenu(selObj,restore)
{
	if (selObj.selectedIndex != 0)
	{
		open_kantoor(selObj.options[selObj.selectedIndex].value,"SG Private Banking - " +selObj.options[selObj.selectedIndex].text);
		if (restore)
		{
			selObj.selectedIndex=0;
		}
	}
	else
	{
		selObj.selectedIndex=0;
	}
}

function open_disclaimer()
{
	var openscherm = window.open("/nl/disclaimer.php?title=Disclaimer","_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700px,height=550px,left=5px,top=5px");
	openschermerrorcheck(openscherm);
}

function nb(event)
{
	x=event.clientX;
	y=event.clientY;
	y = y + 15;
	x = x - 100;
	document.getElementById("nbdiv").style.top = y +"px";
	document.getElementById("nbdiv").style.left = x +"px";
}
function nb2()
{
	document.getElementById("nbdiv").style.top = "-500px";
	document.getElementById("nbdiv").style.left = "-500px";
}

function switchlang()
{
	locatie = document.URL;
	positie = locatie.indexOf("/nl/");
	setCookie("taal","fr",365);
	window.location = ("/fr/"+locatie.substring(positie+4,locatie.length));
}

function switchindex()
{
	setCookie("taal","fr",365);
	window.location = ("/fr/index.php");
}

function setCookie(NameOfCookie, value, expiredays)
{
	var ExpireDate = new Date();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays==null) ? "":"; expires=" + ExpireDate.toGMTString()) + "; path=/";
}

<!--- Flash check --->
// Globals
// Major version of Flash required
var requiredMajorVersion = 7;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;


// Detect Client Browser type
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	// Can't detect in all other cases
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
   	// loop backwards through the versions until we find the newest version	
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;   // 7.0r24 == 7.24
			versionNum        = parseFloat(versionString);
        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
}
