//----------------------------------------------
//----------------------------------------------
//----------------------------------------------
//----JAVASCRIPT 1.4 ---------------------------
//----COPYRIGHTS MEDIA WORKS 2007 --------------
//----------------------------------------------
//----------------------------------------------
//----------------------------------------------
function checkask(){
	em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	if(document.ask.fname.value==""){
		alert("Please Enter your first name");
		document.ask.fname.focus();
	} else if(document.ask.country.value==""){
		alert("Please Enter your Country");
		document.ask.country.focus();
	} else if(em_val.test(document.ask.mailu.value)==false) {
		alert("Invalid E-mail Address");
		document.ask.mailu.focus();
	} else if(document.ask.comments.value==""){
		alert("Please Write Your Question/Comments");
		document.ask.comments.focus();
	} else {
		document.ask.submit();
	}
}
function checknewuser(){
em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
if(document.newuser.usern.value==""){
alert("Enter Username");
} else if(document.newuser.usern.value.length<6){
alert("Username may be minimum 6 characters");
} else if(document.newuser.passn.value==""){
alert("Enter Password");
} else if(document.newuser.passn.value.length<6){
alert("Password may be minimum 6 characters");
} else if(document.newuser.passn.value != document.newuser.cpassn.value){
alert("Confirm Password");
} else if(document.newuser.fname.value==""){
alert("Enter Your First Name");
//} else if(document.newuser.lname.value==""){
//alert("Enter Your Last Name");
//} else if(document.newuser.jobt.value==""){
//alert("Enter Your Job Title");
//} else if(document.newuser.comname.value==""){
//alert("Enter Your Company Name");
} else if(document.newuser.country.value==""){
alert("Enter Country");
} else if(document.newuser.pnumber.value=="" && document.newuser.mnumber.value==""){
alert("Enter Your Phone or Mobile Number");
//} else if(document.newuser.mnumber.value==""){
//alert("Enter Your Mobile Number");
//} else if(document.newuser.mnumber.value==""){
//alert("Enter Your Mobile Number");
} else if(em_val.test(document.newuser.umail.value)==false){
alert("Invalid E-mail Address");
} else {
document.newuser.submit();
}
}
//////
function forgetpass(){
//alert(wi+"-"+yt);
window.open('codepage/forgetpass.php','houhou','scrollbars=no,width=350,height=200');
}

function profile(yt){

window.open('codepage/profile.php?id='+yt,'profile','scrollbars=no,width=500,height=400');
}
function messa(yt){

window.open('codepage/message.php?id='+yt,'message','scrollbars=no,width=500,height=400');
}
//////
function checkupuser(){
em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
if(document.newuser.usern.value==""){
alert("Enter Username");
} else if(document.newuser.fname.value==""){
alert("Enter Your First Name");
} else if(document.newuser.country.value==""){
alert("Enter Country");
} else if(document.newuser.pnumber.value=="" && document.newuser.mnumber.value==""){
alert("Enter Your Phone or Mobile Number");
} else if(em_val.test(document.newuser.umail.value)==false){
alert("Invalid E-mail Address");
} else {
document.newuser.submit();
}
}
//////
//////
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
function getRandomChar(lower) {
var lowerChars = "abcdefghijklmnopqrstuvwxyz";
var charSet = "";
if (lower == true)
charSet += lowerChars;
return charSet.charAt(getRandomNum(0, charSet.length));
}
function getPassword(length) {
var rc = "";
if (length > 0)
rc = rc + getRandomChar();
for (var idx = 1; idx < length; ++idx) {
rc = rc + getRandomChar(true);
}
return rc;
}
function activec() {
document.newuser.activecode.value =getPassword(10);
}
//---------------------end random password-------------------
function trt(tt){
	document.getElementById(tt).bgColor="#fffffc";
	//alert(tt);
}
function trt1(tt){
	//tt.bgcolor="#2e3092";
	document.getElementById(tt).bgColor="#ffffff";
}



function ahmar(tt){
	document.getElementById(tt).bgColor="#FF0000";
	//alert(tt);
}
function aswad(tt){
	//tt.bgcolor="#2e3092";
	document.getElementById(tt).bgColor="#2a2a2a";
}


function trt2(tt){
	//if(document.getElementById(tt).bgColor = "#563b01" ){
	document.getElementById(tt).bgColor="#ffad00";
	//} else {
		//document.getElementById(tt).bgColor="#563b01";
	//}
	//alert(tt);
}
function trt3(tt){
	//tt.bgcolor="#2e3092";
	//document.getElementById(tt).bgColor="#563b01";
	
	//if(document.getElementById(tt).bgColor = "#563b01" ){
	//document.getElementById(tt).bgColor="#ffad00";
	//} else {
		document.getElementById(tt).bgColor="#563b01";
	//}
}
// ROLL OVER / ROLL OUT - COLOR CHANGE
function ch(tt){
	document.getElementById(tt).bgColor="#d22329";
	//alert(tt);
}
function ch1(tt){
	//tt.bgcolor="#2e3092";
	document.getElementById(tt).bgColor="#2e3092";
}

function texto(tt){
	tt.style.color="#ff0000";
}
function texto1(tt){
	tt.style.color="#000000";
}
// play intro
function showintro(){
	window.open('codepage/intro.php','imgbiggo','scrollbars=no,width=520,height=293');
}
// MAILING LIST SUBMIT 
function checkml(){
	em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	if(document.mlist.fn.value==""){
		alert("Please Enter Your Full Name");
		document.mlist.fn.focus();
		return false;
	} else if(em_val.test(document.mlist.ml.value)==false){
		alert("Invalid E-mail Address");
		document.mlist.ml.focus();
		return false;
	} else {
		document.mlist.submit();
	}
	
}
// Post Your Comment 
function checkpost(){
	if(document.postc.name.value==""){
		alert("Please Enter Your Full Name");
		document.postc.name.focus();
		return false;
	} else if(document.postc.comment.value==""){
		alert("Please Write Your Comment");
		document.postc.comment.focus();
		return false;
	} else {
		document.postc.submit();
	}
}
// voting
function checkvote(){
	var rad=document.vtse.elements.length;
	
	var c=0;
	for(i=0;i<rad;i++){
		if(document.vtse.elements[i].checked==true){
			var c=c+1;
		}
	}
	if(c==1){
		document.vtse.submit();
	} else {
		alert("Please Select answer");
	}
}

function voteresult(){
	window.open('codepage/voteresult.php','aboutus','scrollbars=yes,width=300,height=400');
}

function voteresultall(){
	window.open('codepage/voteresultall.php','aboutus','scrollbars=yes,width=300,height=400');
}

// CONTACT US SUBMIT
function checkcontact(){
	em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	if(document.conta.ctfn.value==""){
		alert("Enter Your Full Name");
		document.conta.ctfn.focus();
	} else if(document.conta.ctco.value==""){
		alert("Enter Your Country");
		document.conta.ctco.focus();
	} else if (em_val.test(document.conta.ctml.value)==false){
		alert("Invalid E-mail Address");
		document.conta.ctml.focus();
	} else if(document.conta.ctme.value==""){
		alert("Write The Message");
		document.conta.ctme.focus();
	} else {
		document.conta.submit();
	}
}


// ENLARGE PICTURE
function got(yt,wi,hi,idd){
	hie=Number(hi)+90;
	wie=Number(wi)+18;
	window.open('codepage/viewimg.php?img='+yt+'&id='+idd,'imgbiggo','scrollbars=yes,width='+wie+',height='+hie);
}
// jobs function
function checkmembers(){
	em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	if(document.members.fn.value==""){
	alert("Enter Your Full Name");
	document.members.fn.focus();
	} else if(document.members.placeb.value==""){
	alert("Enter Your Place Of Birth");
	document.members.placeb.focus();
	} else if(document.members.dateb.value==""){
	alert("Enter Your Date Of Birth");
	document.members.dateb.focus();
	} else if(document.members.natio.value==""){
	alert("Enter Your Nationality");
	document.members.natio.focus();
	} else if(document.members.presaddress.value==""){
	alert("Enter Your Present Address");
	document.members.presaddress.focus();
	} else if (em_val.test(document.members.mailo.value)==false){
	alert("Invalid E-Mail Address");
	document.members.mailo.focus();
	} else if(document.members.pnum.value==""){
	alert("Enter Your Phone Number");
	document.members.pnum.focus();
	} else {
	document.members.submit();
	}
}
// send to
function checksend(){
em_val = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/
if(document.sendtof.yourname.value==""){
alert("Please Enter Your Name");
} else if(document.sendtof.friendname.value==""){
alert("Please Enter Your Friend Name");
} else if(em_val.test(document.sendtof.yourmail.value)==false){
alert("Your E-Mail is invalid e-mail address");
} else if(em_val.test(document.sendtof.friendmail.value)==false){
alert("Friend E-Mail is invalid e-mail address");
} else {
document.sendtof.submit();
}
}
//--------------------------------------------------
//--------------------------------------------------
//-----------COPYRIGHTS MEDIA WORKS---2007----------
//--------------------------------------------------
//--------------------------------------------------




