var languageSelector;
var closingtimer;
function showLanguageMenu(){
	languageSelector=new cvcour.Lightbox("",document.getElementById("outerLang").innerHTML,{styleClass:"langSel"});
}

	function jamjam() {
		alert("I am the jamjam, has been called");
	}

function showexecwindow(isurl,theurl,thewid,thehei,thehdng,showcontrols,isautohide,toredirect){
	var overlaycontent				= document.getElementById('black-overlay');
	overlaycontent.style.display = 'block';
	
	var isurl;
	var theurl;
	var thewid;
	var thehei;
	var thehdng;		// error , success
	var showcontrols;	// 1=show controls, 0=hidecontrols.
	var isautohide;		// true = initiate  setTimeout function, false=nothing
	var toredirect;
	if(toredirect == "" || toredirect == null) {
		istodirect = 0;
		toredirect = "";
	} else {
		istodirect = 1;
		toredirect = toredirect;
	}
	testvars = "";
	testvars += "isurl : " + isurl + "\n";
	testvars += "theurl : " + theurl + "\n";
	testvars += "thewid : " + thewid + "\n";
	testvars += "thehei : " + thehei + "\n";
	testvars += "thehdng : " + thehdng + "\n";
	testvars += "showcontrols : " + showcontrols + "\n";
	testvars += "isautohide : " + isautohide + "\n";
	testvars += "istodirect : " + istodirect + "\n";
	testvars += "toredirect : " + toredirect + "\n";
	//alert(testvars);
	
	if(thehdng == "error") {
		thehdng = "<span style='font-family: Arial; font-size: 16px; color:#990000' >Error found!.</span>";
	}else if(thehdng == "success") {
		thehdng = "<span style='font-family: Arial; font-size: 16px; color:#003333' >Valid Entry!.</span>";
	}else if(thehdng == "login") {
		thehdng = "<table><tr><td><span style='font-family: Arial; font-size: 16px; color:#333333' >Signing In!.</span></td><td align=left valign=middle><span><IMG src='includes_supporters/images/pagination/ajax-loader.gif' align=middle border=0 title='please wait'></span></td></tr></table>";
	}else if(thehdng == "logout") {
		thehdng = "<table><tr><td><span style='font-family: Arial; font-size: 16px; color:#333333' >Signing Out!.</span></td><td align=left valign=middle><span><IMG src='includes_supporters/images/pagination/ajax-loader.gif' align=middle border=0 title='please wait'></span></td></tr></table>";
	}else if(thehdng == "alreadylogged") {
		thehdng = "<table><tr><td><span style='font-family: Arial; font-size: 16px; color:#333333' >You are already Logged in!.</span></td><td align=left valign=middle><span><IMG src='includes_supporters/images/pagination/ajax-loader.gif' align=middle border=0 title='please wait'></span></td></tr></table>";
	}
	var thetothtm;
	thetothtm = "";
	thetothtm = thetothtm + "<DIV id=outerLang>";
	thetothtm = thetothtm + "<DIV class=langSelector id=langSelector>";
	if(showcontrols == "1") {
	thetothtm = thetothtm + "<DIV class=closeIcon><A onclick=closeLangSelector(); href=javascript:void(0)><IMG src='includes_supporters/images/15x15_remove.gif' align=middle border=0 title='close'></A></DIV>";
	}
	thetothtm = thetothtm + "<DIV id=langHeader>";
    thetothtm = thetothtm + "<DIV><strong>" + thehdng + "</strong></DIV>";
    thetothtm = thetothtm + "</DIV>";
    thetothtm = thetothtm + "<DIV class=mapArea>";
	thetothtm = thetothtm + "<DIV style=display:block; width: 300px; height:50px; border: solid 1px #FF0000; overflow: auto;>";
	if(isurl == "1" ) {
    	thetothtm = thetothtm + "<IFRAME id=thsefrmae src=" + theurl + " frameBorder=0 width=" + thewid + " height=" + thehei + " style=border:solid 1px #D1E0EF;></IFRAME>";
	} else if(isurl == "0" ) {
		thetothtm = thetothtm + theurl;
	}
	thetothtm = thetothtm + "</DIV>";
    thetothtm = thetothtm + "</DIV>";
    thetothtm = thetothtm + "<DIV id=langFooter>";
	if(showcontrols == "1") {
		thetothtm = thetothtm + "<DIV><BUTTON id=dialog-accept onclick=closeLangSelector();>Ok.</BUTTON></DIV>";
	}
    thetothtm = thetothtm + "</DIV>";
	thetothtm = thetothtm + "</DIV>";
	thetothtm = thetothtm + "</DIV>";
	languageSelector=new cvcour.Lightbox("",thetothtm,{styleClass:"langSel"});
	if(isautohide == "true") closingtimer=setTimeout("closeLangSelector("+istodirect+",'"+toredirect+"')",5000);  //5secounds
	
}

function closeLangSelector(istoredirect, redirectto){
	var overlaycontent				= document.getElementById('black-overlay');
	overlaycontent.style.display = 'none';
	
	var istoredirect;
	var redirectto;
	//alert("I am being called");
	clearTimeout(closingtimer);
	if(istoredirect == "1") {
		window.location = redirectto;
	}
	languageSelector.close();
	
}

