





	
    var progress = 0;
    function  show() {
	    //document.getElementById("progress").style.display = 'block';
	    //document.all["progress"].style.display = "block";
	    //alert('here');
	    setTimeout('progressBarMessage()',10);
    }
	
    function progressBarMessage() {
    	var progMessage = document.getElementById("progressMessage");
    	progMessage.style.fontWeight="bolder";
    	progMessage.style.fontSize="larger";
    	progMessage.style.color="red";
    	progMessage.innerHTML="<img src='images/upload.gif' ><img src='images/processingDots.gif'>";
    //	promptMessage.innerHTML="<img src='images/processingDots.gif' >";
    //	promptMessage.innerHTML="<img src='images/bar.gif' >";
    //	promptMessage.innerHTML="<img src='images/progress.gif' >";
    }
	
	function trim(val) {
//	    alert('okkkk');
		if( val != null && val != "") {
			val = val.replace(/(^\s+)/,""); // for LTrim
			val = val.replace(/(\s+$)/,""); // for RTrim
		}
		return val;
	}
	
    function checkEmail(emailaddress) {
        emailaddress = trim(emailaddress);
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(emailaddress) ){
		    return (true);
        }
        alert("Invalid email ! please re-enter.");
        return (false);
    }	
    
    // check radio button is checked or not ; parameter (radiobox) -> document.form.field
    function radiocheck(radiobox) {
        for( ic = 0; ic < radiobox.length ; ic ++ ) {
        	if (radiobox[ic].checked) {
        		return true; 
        	}
        }
        return false;
    }
function funback() {
	history.back();
}

	function funmenu(menu_no) {
		if( document.fcommon.state_id.value == '' && document.fcommon.city_id.value != ''
				&& document.fcommon.city_id.value.length >= 2 ) {
			document.fcommon.state_id.value = (document.fcommon.city_id.value).substring(0,2);
		}
		if( menu_no == 'ad-post' ) {
			document.fcommon.mode.value = 'newutil';
			if( document.fcommon.city_id.value == '' && document.fcommon.state_id.value == '' ) {
				document.fcommon.action = 'location.do';
			}
			else {
				document.fcommon.action = 'cate.do';
			}
		}
		if( menu_no == 'ad-ser' ) {
			document.fcommon.mode.value = 'city';
			if( document.fcommon.city_id.value == '' && document.fcommon.state_id.value == '' ) {
				document.fcommon.action = 'location.do';
			}
			else {
				document.fcommon.action = 'cate.do';
			}
		}
		if( menu_no == 'ad-alert' ) {
			document.fcommon.mode.value = 'newutil';
			document.fcommon.action = 'aalert.do';
		}
		document.fcommon.submit();
	}	

	
    function funchangelocation() {
        document.fcommon.action = 'location.do';
        document.fcommon.submit();
    }

	
    function fununderconstruction() {
        alert('Coming soon, Site under construction!!');
    }
   
	var req;
	var citytype;
	//var which;
	function funProcessGenURL(state_id,type) {
	//(state_id);
	//alert(type);
		var index = state_id.indexOf('0000');
		if( index == -1 ) {
			document.getElementById(type).innerHTML = '&nbsp';
		}
		else {
		    //alert(type);
		    document.getElementById(type).innerHTML = '&nbsp';
			retrieveURLOption('dynamiclist.do?val='+state_id+'&listname='+type,type);
		}
	}
	
	function funProcessGenCitiesURL(mode,state_id,type) {
	    document.getElementById(type).innerHTML = '&nbsp';
	    document.getElementById(type+"progress").style.display = "";
	    //alert('dynamiclist.do?mode='+mode+'&val='+state_id+'&listname='+type,type);
		retrieveURLOption('dynamiclist.do?mode='+mode+'&val='+state_id+'&listname='+type,type);
		document.getElementById(type+"progress").style.display = 'none';
	}	
	
	function retrieveURLOption(url,type) {
	   // alert('1'+type);
	   citytype = type;
    	if (window.XMLHttpRequest) { // Non-IE browsers
      		req = new XMLHttpRequest();
		    req.onreadystatechange = processPlacementChange;
      		try {
		        req.open("GET", url, true);
      		} 
      		catch (e) {
		        alert(e);
      		}
		    req.send(null);
	    } 
	    else if (window.ActiveXObject) { // IE
      		req = new ActiveXObject("Microsoft.XMLHTTP");
      		if (req) {
        		req.onreadystatechange = processPlacementChange;
        		req.open("GET", url, true);
        		req.send();
      		}
    	}
	
	}
	function processPlacementChange(type) {
  	    //alert(type);
    	if ( req.readyState == 4 ) { // Complete
      		if (req.status == 200) { // OK response
      			//alert(req.responseText);
        		document.getElementById(citytype).innerHTML = req.responseText;
      		} 
      		else {
        		alert("Problem: " + req.statusText);
      		}
    	}
  	}  	
  	
  	
	function funProcessJobURL(state_id) {
		var index = state_id.indexOf('0000');
		if( index == -1 ) {
			document.getElementById("cityplace").innerHTML = '&nbsp';
		}
		else {
		    document.getElementById("cityplace").innerHTML = '&nbsp';
		    showcityprogress();
			retrieveURL('dynamiclist.do?val='+state_id);
		}
	}

    function showcityprogress() {
       // alert(document.getElementById("othercityid").style.display);
       
        document.getElementById("othercityid").style.display = "";
    }
    function hidecityprogress() {
        document.getElementById("othercityid").style.display = "none";
    }

	function funProcessURL(state_id) {
		//alert(state_id);
		
		var index = state_id.indexOf('0000');
		//alert(index);
		if( index == -1 ) {
			document.getElementById("cityplace").innerHTML = '&nbsp';
			//retrieveURLOption('dynamiclist.do?mode=placamentfirm&val='+state_id,'firm');
		}
		else {
		    //document.getElementById("placamentfirm").innerHTML = '<span class=\"data\"><b>No Placement firm found</b></span>';
		    document.getElementById("cityplace").innerHTML = '&nbsp';
		    showcityprogress();
			retrieveURL('dynamiclist.do?val='+state_id);
		}
		
	}
	

	function retrieveURL(url) {
		
	//	alert(url);
    	if (window.XMLHttpRequest) { // Non-IE browsers
      		req = new XMLHttpRequest();
		    req.onreadystatechange = processStateChange;
      		try {
		        req.open("GET", url, true);
      		} 
      		catch (e) {
		        alert(e);
      		}
		    req.send(null);
	    } 
	    else if (window.ActiveXObject) { // IE
      		req = new ActiveXObject("Microsoft.XMLHTTP");
      		if (req) {
        		req.onreadystatechange = processStateChange;
        		req.open("GET", url, true);
        		req.send();
      		}
    	}
  	}

  	function processStateChange() {
  	   
  	    //wait();
    	if ( req.readyState == 4 ) { // Complete
      		if (req.status == 200) { // OK response
      			//alert(req.responseText);
        		document.getElementById("cityplace").innerHTML = req.responseText;
        		hidecityprogress();
      		} 
      		else {
        		alert("Problem: " + req.statusText);
      		}
    	}
  	}    
  	
    
    
    
    

/*
    function over_b_image(parm_name) {
     	alert(parm_name);
     	alert("images/"+parm_name+"1.gif");
     	alert(document[parm_name].src);
        document[parm_name].src = "images/"+parm_name+"1.gif";
       alert(document[parm_name].src);
     }
    function off_b_image(parm_name) {
     	//alert(parm_name);
     	//alert("images/"+parm_name+img_no+".gif");
     	//alert(document[parm_name].src);
        document[parm_name].src = "images/"+parm_name+".gif";
        //alert(document[parm_name].src);
     }
   */