//<![CDATA[
//Nobody want these function in their place

var myScreen;
var myData;
function change_lang()
{
	XPX(0,0,'change_lang.php','',w$.reload);
//	myScreen = new xpWait('myScreen');
//	myData = new xpAjax('myData');
//	myData.aget('change_lang.php','myScreen.flash()');  
}


var currheight=null;
var windowResizeTimeout=false;		//timeout
function windowOnResize(){
	//fix for sb IE (IE fire onresize incorrectly , when body size changed !! )
	if(currheight != document.documentElement.clientHeight)
	{
		if( windowResizeTimeout)
			clearTimeout(windowResizeTimeout);
		 windowResizeTimeout = setTimeout('w$.reload()',500);
	}
	currheight = document.documentElement.clientHeight;
}


/* this function will called after page been load*/ 
function page_init()
{

	//will show vertical scrollbar in firefox
	//window_push(); use css html over flow 
	//document.body set as 2000px in css
	document.body.style.height="auto";
	var hf= window.location+' ';
	//show test mark
//	$('test_mark').style.visibility = "visible";
//	if( hf.indexOf('eplanner.com') < 0  ){
//		w$.opacity($('test_mark'),60);
//	}else{
//		w$.opacity($('test_mark'),5);
//	}
	//hook for resize
	currheight = document.documentElement.clientHeight;

	//setTimeout('window.onresize = windowOnResize',1000);	
//	var holder = $('bodyHold');
//	w$.opacity(holder,0)
//	holder.style.visibility = 'visible';
//	w$.fade(holder,0);
//	if($('hidden_google'))
//		$('hidden_google').src = "google.analytic.html";
//	$('hidden_alexa').src = "alexa.rank.html";
//	$('hidden_onestat').src = "onestat.html";
//	$('hidden_extreme').src = "extreme.html";
//	setTimeout("w$.keepAlive('ping_me.php')",60000);



	// 2009 09 23 add this for iframe (white label)
	var bc =' ' +document.body.className;
	if( bc.indexOf('iframe')>0)
	{
		var p = $('memberThingy').innerHTML

		var tools = $('tools') ? $('tools') : $('tools1')
		var ul =w$.findDescendantsByTag(tools,'ul')

		for(var i=0; i<ul.childNodes.length;i++)
		{
			var li = ul.childNodes[i];
			if(li.className && (' '+li.className).indexOf('selected')>0)
			{
				li.innerHTML += '<p id="zac323">'+p+'</p>';
			}
		}
	}
	


}
function get_vcode()
{
//	w$.reload();
	var d = new Date();
	//alert(12)
	//$('theVcode').src="images/60x80.jpg";
	$('theVcode').src="/vcode.php?xp=12&type=md5&crypt=des3&used=timestamp&serverkey=191213834984762346&password=ThisIsPassword&timeout="+ d.getTime();
	
}

function contact_us()
{
	//if(!arguments[0]){arguments[0] = '';}	//hacked by zac
	//new xpFrame(arguments[0] + '/mb_contact_us_div.php');
	new xpFrame('/mb_contact_us_div.php');
}

function feed_back()
{
	if(!arguments[0]){arguments[0] = '';}
	new xpFrame('/mb_feed_back_div.php');
}

function report_bug(page)
{
	if(!arguments[1]){arguments[1] = '';}
	new xpFrame('/mb_report_bug_div.php?page='+page);
}


//clean page
function clean_page(noreturn){

	var s=w$.ws();
	var bk 	=$('site_background');
	var nodes = document.body.childNodes;
	for(var i=0; i<nodes.length;i++){
		if(nodes[i].id !='site_background' && nodes[i].tagName == 'DIV')
			nodes[i].style.display='none';
	}
	w$.opacity($('bodyHold'),0)//.style.visibility ='hidden';
	//$('bodyHold').style.visibility ='hidden';
	//move up
	window.scrollTo(0,0);

////////90305
//	var s=w$.ws();
//	var bk 	=$('site_background');
//	
//	var nbk = w$.copyElement(bk);
//	bk.style.display="none";
//	nbk.innerHTML = "&nbsp;"
//	nbk.style.height =s.h-10+"px"



//	var bk = document.body;//$('site_background')
//	bk.style.height=s.h-20+'px';
//	bk.style.top=0+'px';
//	bk.style.overflow='hidden';
////	alert(s.h)
//	bk.innerHTML='&nbsp;';
//	var new_el = bk.cloneNode(true);
//	document.body.innerHTML = '';
//	document.body.appendChild(new_el);
	//return false;
}
//name alias
var page_clean = clean_page;
//V3 js
function media_select(el,n){
	var as = $$('a',el.parentNode)
	for(var i=0;i<as.length;i++){
		as[i].className = 'media_button';
	}
	$('media_image').style.display='none';
	$('media_video').style.display='none';
	$('media_map').style.display='none';
	
	el.className = 'media_button on'
	$('media_'+n).style.display = '';
	$('media_'+n).style.visibility = 'visible';
}


function show_comp_chance()
{
	new xpFrame('/mb_show_t_and_c.php?page=chance-of-winning');
}

function show_comp_terms()
{
	new xpFrame('/mb_show_t_and_c.php?page=competition-terms-and-conditions');
}
//]]>

