function pagegoto(curtpage,pageName){
	var test = document.getElementById('currpage').value;
}
	function buildimage(imageHeight, imageWidth, imageType, baseURL, imageURL, links)
	{
			var obj = document.getElementById('container')
			var index = Math.floor(Math.random() * 1000);
			var index1  = Math.floor(Math.random() * 10000000);
			if (imageType == "ThumbNail")
			i = 6;
			else
			i = 12;
			if (baseURL == "nill")
			baseURL = "";
			else
			baseURL = baseURL+"/";
			var url =  baseURL+imageURL+"?"+index.valueOf();
			var url1 = baseURL+imageURL+"?"+index1.valueOf();
			var inner_html = "";
			if ((imageWidth == '76') && (imageHeight == '76')){
					inner_html += '<div Id="great"><table cellpadding="0" cellspacing="0" border="0">';
					inner_html += '<tr valign="top" align="middle">';
					inner_html += '<td width="75" height="75" class="small_thumb_format float">';
					if (links != "nill")
					inner_html += '<a href="'+links+'">';
					inner_html += '<img  name="sets" id="sets" src="' + url + '" border="0" width="75" height="75" oncontextmenu="return false;">';
					if (links != "nill")
					inner_html += '</a>';
					inner_html += '</td>';
					inner_html += '</tr>';
					inner_html += '</table></div>';			
				} 
			else if ((imageWidth == '75') && (imageHeight == '75'))
				{
					
					inner_html += '<table cellpadding="0" cellspacing="0" border="0" width="99">';
					inner_html += '<tr>';
					inner_html += '<td width="99px" height="99px" style="background-image:url(' + url + '); background-position:center; background-repeat:no-repeat;">';
					if (links != "nill")
					document.write('<a href="'+links+'">');
					if (imageType == "ThumbNail")
						{
						inner_html += '<img src="skins/main/images/account/dropshadows/i_border.gif" border="0" width="99" height="99" oncontextmenu="return false;" >';
						}
						else
						{
						inner_html += '<img src="skins/main/images/account/dropshadows/i_border_video.gif" border="0" width="99" height="99" oncontextmenu="return false;" >';
						}
					if (links != "nill")
					inner_html += '</a>';
					inner_html += '</td>';
					inner_html += '</tr>';
					inner_html += '</table>';
				}
				else
				{
					inner_html += '<div Id="great"><table cellpadding="0" cellspacing="0" border="0">';
					inner_html += '<tr valign="top" align="middle">';
					inner_html += '<td class="small_thumb_format float">';
					if (links != "nill")
					inner_html += '<a href="'+links+'">';
					inner_html += '<img  name="sets" id="sets" src="' + url + '" border="0" width="' + imageWidth + '" height="' + imageHeight + '" oncontextmenu="return false;">';
					if (links != "nill")
					inner_html += '</a>';
					inner_html += '</td>';
					inner_html += '</tr>';
					inner_html += '</table></div>';
					//var test = document.getElementById("sets");
					//test.src =url;
					
				}
				obj.innerHTML = inner_html;
				
	}
	
	function includeCss(hrefLink){

	    var links = document.getElementsByTagName("link");
	    var found = false;
	    for(i=0;i<links.length;i++)
	     {
	        var lnk = links[i].href;
	     	if(lnk.indexOf(hrefLink)!=-1){
	       		found = true;
	     	}
	     }
	     if(!found){
	      document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\""+hrefLink+"\" />");
	     }
	}
	
	
	/* The regex in this function should match UserLoginAndRegUtil.isValidUserName.*/

	function isSpecialInclude( obj )
	{
		var reDname=/^[_a-zA-Z0-9-~`!@#$%^&*()_ +=\[\]{}\\|:;'\",.?\/]+$/;
		if (obj.search(reDname)==-1) //if match failed
		{
			return false;
		}
		else
		{
			return true;
		}
	} 

	function moveToReviewPageInternal(val)
	{		
		var url2 = "";
		var reqParams = "";
		var userid = document.getElementById("userid").value;
		var ajaxUrl = document.getElementById("ajaxUrl").value;
		if(ajaxUrl==null)ajaxUrl ="";			
		if(val!=null && userid!=null){
			url2 = ajaxUrl+"/ajaxreview.do";
			reqParams = "cpageno="+val+"&userid="+userid;		
			reviewPost(url2,"afterPost(request)",reqParams);
		}		
		return false;
	}	
	

	function reviewPost(url,callBack,reqParameters){		
		var locationUrl = document.location+"";
		if(locationUrl.indexOf(":80")==-1 && url.indexOf(":80")!=-1){
	 		var temp = url.substring(0,url.indexOf(":80"));
	 		var temp1 = url.substring(url.indexOf(":80")+3,url.length);
	 		url = temp + temp1;
		} 	
		var request=document.all?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
	 	request.onreadystatechange=function(){
	  		if(request.readyState==4){
	   			if(request.status==200){ 	
	         		try{eval(callBack);}catch(e){}
	   			}    
	  		}
	 	}
		request.open("POST",url,true);
		request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		request.setRequestHeader("Content-length", reqParameters.length);
		request.setRequestHeader("Connection", "close");	
		request.send(reqParameters); 
	}
	 function afterPost(request)
	{
		try{			
			document.getElementById('reviewdiv').innerHTML=request.responseText;
		}catch(e){}
		
		
	}
	 
	 
//alert('Alert from JS');
	 
	
// Email Address Validation
	 
 function validateEmailId(emailId){
	var at="@"
	var dot="."
	var lat=emailId.indexOf(at)
	var lstr=emailId.length
	var ldot=emailId.lastIndexOf(dot)
	
	if( lat<1 || ldot-lat<2 ){
		return false
	}
	if (emailId.indexOf(at)==-1){
	   return false
	}

	if (emailId.indexOf(at)==-1 || emailId.indexOf(at)==0 || emailId.indexOf(at)==lstr){
	   return false
	}

	if (emailId.indexOf(dot)==-1 || emailId.indexOf(dot)==0 || emailId.indexOf(dot)==lstr){
	    return false
	}

	 if (emailId.indexOf(at,(lat+1))!=-1){
	    return false
	 }

	 if (emailId.substring(lat-1,lat)==dot || emailId.substring(lat+1,lat+2)==dot){
	    return false
	 }

	 if (emailId.indexOf(dot,(lat+2))==-1){
	    return false
	 }
	
	 if (emailId.indexOf(" ")!=-1){
	    return false
	 }
	 return true	
 }
 function SetFocus(objId) 
 {     
    var focusObject = document.getElementById(objId);
    if(focusObject)    
    {        
      focusObject.focus();     
    }else{
      return;  
    }
 }
 
function validateRememberMe()
{
    var existingRemObj  = document.getElementById('select_rem_value');
    if (typeof console === "object" ) { console.log("existingRemObj  "+ existingRemObj) }
	if(existingRemObj && existingRemObj.value == 'ON' )
	{
		//if (typeof console === "object" ) { console.log("existingRemObj ON "+ existingRemObj) }
		document.getElementById('remember_id').className='checkbox unchecked';
		existingRemObj.value='OFF'
		document.f1.TARGET.value=document.f1.originaltarget.value;

	}else if(existingRemObj && existingRemObj.value == 'OFF'){
		//if (typeof console === "object" ) { console.log("existingRemObj OFF "+ existingRemObj) }
    	document.getElementById('remember_id').className='checkbox checked';
    	existingRemObj.value='ON'
		document.f1.TARGET.value=document.f1.originaltarget.value+"&savecredsflag=true";
	}

}

function validateRememberMeUr2()
{
    var existingRemObj  = document.getElementById('select_rem_value1');
    if (typeof console === "object" ) { console.log("existingRemObj  "+ existingRemObj) }
	if(existingRemObj && existingRemObj.value == 'ON' )
	{
		//if (typeof console === "object" ) { console.log("existingRemObj ON "+ existingRemObj) }
		document.getElementById('remember_id1').className='checkbox unchecked';
		existingRemObj.value='OFF'
		document.f1.TARGET.value=document.f1.originaltarget.value;

	}else if(existingRemObj && existingRemObj.value == 'OFF'){
		//if (typeof console === "object" ) { console.log("existingRemObj OFF "+ existingRemObj) }
    	document.getElementById('remember_id1').className='checkbox checked';
    	existingRemObj.value='ON'
		document.f1.TARGET.value=document.f1.originaltarget.value+"&savecredsflag=true";
	}

}

 //Below functions added for mobile issue purpose,Maintaining password filed with default text.
function setdefaultvalue() {
    //document.getElementById('password-label').style.display = 'none';
	document.getElementById('up-create-password').value.length == 0;
    document.getElementById('up-create-password').style.display = 'inline';
    document.getElementById('up-create-password').focus();
}
function checkPassword() {	
    if (document.getElementById('up-create-password').value.length == 0) {
        //document.getElementById('password-label').style.display = 'inline';
        document.getElementById('up-create-password').style.display = 'inline';
    }
}


