function setVisibility(i, visi) {
	//document.getElementById('scsb').style.visibility = (visi == "none"?"visible":"hidden");
	document.getElementById(i).style.display = visi;
}

function loginUser()
{
	var userName     = document.getElementById('j_username').value;
	var userPassword = document.getElementById('j_password').value;
	if(validate(document.loginForm))
  	ajax.callurl('process.php?action=login', 'logIn', 'userName='+userName+'&Password='+userPassword);
}

function isIdAvailable(val)
{
		var a = document.getElementById("avail");
    	if(val){
		if(val.indexOf(" ") >= 0){
			with(a.style){
				textDecoration = "none";
				color = "red";
			}
	    a.innerHTML = "Whitespace Not Allowed!";
			return;
		}
        		with(a.style){
            		textDecoration = "none";
		            color = "black";
        		}
        		a.innerHTML = "checking availability...";
	        	ajax.callurl("process.php?action=idcheck&u=" + val, "lia");
        		ajax.obj = a;
    	}
	else
		a.innerHTML = '';
}

//--check for site name--->
function isSiteAvailable(val)
{
		var a = document.getElementById("avail");
		var b = document.getElementById("button_id");
		var c = document.getElementById("submit_id");
    	if(val){
		if(val.indexOf(" ") >= 0){
			with(a.style){
				textDecoration = "none";
				color = "red";
			}
	    a.innerHTML = "Whitespace Not Allowed!";
			return;
		}
        		with(a.style){
            		textDecoration = "none";
		            color = "black";
        		}
        		a.innerHTML = "checking availability...";
	        	ajax.callurl("process.php?action=sitecheck&u=" + val, "liap");
        		ajax.obj = a;
				ajax.obj1 = b;
				ajax.obj2 = c;
    	}
	else
		a.innerHTML = '';
}

//---site form validation-->
function site_validate(){
  if(document.getElementById('site_name').value == ""){
	  alert("Please enter your site name");
		document.getElementById('site_name').focus();
		return false;
	}
  var a = document.getElementById('avail');
	if(document.frm_web.name == "frm_web"  && a && a.style.color == "red"){
			alert(a.innerHTML);
			document.frm_web.site_name.focus();
			return false;
	 }
}


//--check for site name--->
function shwMetaContents(val)
{
		var a = document.getElementById("rest_Id");
    	if(val != '')
		{
			
		if(val.indexOf(" ") >= 0){
			with(a.style){
				textDecoration = "none";
				color = "red";
			}
	    a.innerHTML = "Whitespace Not Allowed!";
			return;
		}
        		with(a.style){
            		textDecoration = "none";
		            color = "black";
        		}
        		a.innerHTML = "<table width='100%' border='0' cellspacing='1' cellpadding='1'><tr><td height='150' align='center'><img src='images/loader.gif' /></td></tr></table>";
				
	        	ajax.callurl("ajax_pages/email_drop_down.php?action=page_content&value="+ val,"shwPage");
        		ajax.obj = a;
    	}else{
		 a.innerHTML = '';
		 alert("Please select a Page Name !!");
			}
}


