/*--- flash movie clip on the top left side ---*/
function players2(){
window.document.write('<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="168" height="154" id="players" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="images/players2.swf" /><param name = "wmode" value = "transparent"><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="images/players2.swf" quality="high" bgcolor="#ffffff" wmode = "transparent" width="168" height="154" name="players" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');}

function center(){
window.document.write('<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="350" height="154" id="center" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="images/center.swf" /><param name="wmode" value="transparent"><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="images/center.swf" quality="high" bgcolor="#ffffff" wmode="transparent" width="350" height="154" name="center" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function topBanner(num){
window.document.write('<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="570" height="154" id="topbanner" align="middle"><param name="wmode" value="transparent"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="images/topbanner'+num+'.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="images/topbanner'+num+'.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="570" height="154" name="topbanner" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

/*--- verifying email address ---*/
function email_onblur(eAd){
	var fEmail = document.registration.email;
	var answer = (/^[\w._%-]+@[\w.-]+\.[a-zA-Z]{2,6}$/.test(eAd));
	if(answer){
		return true;
	}else{
		alert("Please enter valid email address.");
		fEmail.select();
		fEmail.focus();
		return false;
	}
}

/*--- check if passwords are typed same twice ---*/
function password_onblur(){
	var pw1=document.registration.password;
	var pw2=document.registration.verifypw;
	if(pw1.value!=pw2.value){
		alert("Password is not verified: please make sure your password.");
		pw2.focus();
		pw2.select();
	}
}

/*--- confirm popup for any value ---*/
function confirm_this(x){
	var r=confirm("Are you sure to "+x+" this record?")
	if (r==true){
		return true;
	}else{
		return false;
	}
}

/*--- changing 'expanded' & 'collapsed' for span class ---*/
function toggleMenu(id) {
	element = document.getElementById(id);
	element.className = (element.className.toLowerCase() == 'collapsed'?'expanded':'collapsed');
}

function switchClass(id, before, after) {
	element = document.getElementById(id);
	element.className = (element.className.toLowerCase() == before?after:before);
}

function leaveOpen(me){
	toggleMenu(me);
}

/*--- passing the value from child to parent(name: pform)---*/
function get_image(x){
	if(window.opener.pform.picture.value==""){
		window.opener.pform.picture.value=x;
	}else{
		window.opener.pform.picture2.value=x;
	}
	window.close();
}

/*---popup windwos for links---*/
var h=screen.height/2;
var w=screen.width;
function wOpenFull(page){
	var screenH=screen.height;
	var pop;
	pop = window.open( page, 'p', 'top=0, left=0, width='+w+',height='+screenH+',resizable,menubar,scrollbars,location,toolbar');
	pop.focus();
	return pop;
}

/*---popup windwos for edit pictures page---*/
var pich=650;
var picw=550;

function forgotForm(){
	var forgotForm = document.getElementById( 'forgot' );
	forgotForm.innerHTML = '<label>Username: </label><input type = "text" name = "myName" size = "25">			<label>Email: </label><input type = "text" name = "email" size = "25"><input type = "submit" name = "forgot" class = "niceinput" value = "send">';
	return false;
}

function alertSize() {
		  
		  var myWidth = 0, myHeight = 0;
		  
		  if( typeof( window.innerWidth ) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		  }
		  //window.alert( 'Width = ' + myWidth );
		  //window.alert( 'Height is ' + myHeight );

		  if(myHeight > 750) {
			 newheight = (myHeight - 745) * 2;
			document.getElementById("spacer").style.height = newheight;
		  }
	}
	
function fOpenWin(){
	window.open('goal.php','window','top=50,left=50,width=700,height=550,scrollbars=no ,location=yes, status=no');
}

function closeWin()
{
myWindow.close();
}
	