// JavaScript Document

function clearText(field){

	if (field.defaultValue == field.value) field.value = '';
	else if (field.value == '') field.value = field.defaultValue;

}	

function newPic(arg) {
		if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
		}
		}
		
		function changePics() {
		if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changePics.arguments.length; i+=2) {
		document[changePics.arguments[i]].src = changePics.arguments[i+1];
		}
		}
		}
		
		var preloadFlag = false;
		function preloadPics() {
		if (document.images) {
		nav_doc_key_o = newPic("/images/nav_doc_key_o.gif");
		nav_send_res_o = newPic("/images/nav_send_res_o.gif");
		nav_home_o = newPic("/images/nav_home_o.gif");
		nav_cam_o = newPic("/images/nav_cam_o.gif");
		nav_post_o = newPic("/images/nav_post_o.gif");
		nav_faq_o = newPic("/images/nav_faq_o.gif");
		nav_doc_o = newPic("/images/nav_doc_o.gif");
		nav_tie_o = newPic("/images/nav_tie_o.gif");
		nav_buy_views_o = newPic("/images/nav_buy_views_o.gif");
		nav_proccess_o = newPic("/images/nav_proccess_o.gif");
		nav_cog_o = newPic("/images/nav_cog_o.gif");
		preloadFlag = true;
		}
		}
		
		function splashpic (folder){
			
			var length = 80;
			var ran_num = Math.round((length-1)*Math.random());
			ran_num=ran_num+1;
			var source = "/images/photos/"+ folder+"/"+ran_num+".gif";						
			document.images['splash'].src = source;
			
		}		
		
		
		function auth_win(){
				Auth_window=window.open('defend.asp', "detail","width=400,height=180,toolbar=no,status=no,menubar=no,scrollbars=no");
				Auth_window.focus();
			}
		
		function reDir(lnk){
				desc_window=window.open(lnk, "detail","width=675,height=520,toolbar=no,status=no,menubar=no,scrollbars=yes");
				desc_window.focus();
			}	
			
			
		function enableField(form){
			form.firstn.disabled = false;
			form.lastn.disabled = false;		
			form.btnGoldMember.disabled = false;
		}
		
		function diabledField(form){
			form.firstn.disabled = true;
			form.lastn.disabled = true;	
			form.btnGoldMember.disabled = true;
		}
		
		function checkvalues(form){
			var radio_choice = false;
	
			for (counter = 0; counter < form.agreerules.length; counter++)
			{
				if (form.agreerules[counter].checked)
				radio_choice = true; 
			}
			
			if (!radio_choice)
			{
				alert("Please select a one of the options for Rules & Regulation.")
				return (false);
			}
			
			if (radio_choice){
				if(form.agreerules[1].checked == false)
				{
					if (form.firstn.value == ""){
						alert("Please enter your First Name.")
						return (false);
					}
					else if (form.lastn.value == ""){
						alert("Please Last Name.")
						return (false);
					}
				}
			}
	
			form.submit();
		}		
		
		function window_popup(url,x,y){
		var winl = (screen.width - 300) / 2;
		var wint = (screen.height - 500) / 2;
		newWindow = window.open(url, 'CommentWin', 'toolbar=no,menubar=no,status=no,scrollbars=yes,width='+x+',height='+y+',top='+wint+',left='+winl);
		newWindow.focus();		
		}
		
		
		function MM_displayStatusMsg(msgStr) { //v1.0
	  		status=msgStr;
	  	document.MM_returnValue = true;
		}
		
		
		var strShow = 'Show';
		var strHide = 'Hide';
		var strRtl = '';
	
		function go(url)
		{
			window.open(url, "_self");
		}
	
		function OpenInNewWindow(url)
		{
			go(url);
		}	
		
		function win_popup(x,y){
			var winl = (screen.width - 750) / 2;
			var wint = (screen.height - 600) / 2;
			newWindow = window.open('snap_shot_preview.asp', 'CommentWin', 'toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes,width='+x+',height='+y+',top='+wint+',left='+winl);
			newWindow.focus();		
		}
		
		
		function short_popup(url,x,y){
			var winl = (screen.width - 300) / 2;
			var wint = (screen.height - 500) / 2;
			newWindow = window.open(url, 'CommentWin', 'toolbar=no,menubar=no,resizable=no,titlebar=no,status=no,scrollbars=no,width='+x+',height='+y+',top='+wint+',left='+winl);
			newWindow.focus();		
		}							
		
		function CheckSearch(){
			if(document.job_category.jobcategory_id.value == ""){
				alert("Please select one of the Job Category")
				return false;
			}
			else{
				document.job_category.submit();
				return true;
			}	
		}
		
		function CheckKeywordSearch(){
			if(document.keywordsearch.keyword.value == ""){
				alert("Please enter keyword to search")
				return false;
			}
			else if(document.keywordsearch.keyword.value.length < 2 ){
				alert("Please enter 2 or more characters for keyword")
				return false;
			}
			else{
				document.keywordsearch.submit();
				return true;
			}	
		}
		
		function go(url)
		{
			window.open(url, "_self");
		}
	
		function OpenInNewWindow(url)
		{
			go(url);
		}	
