﻿// JScript File

function gourl(value1, value2)
{
	var strUrl=window.location.href;
	switch(value1)
	{
		case "mode1":
		if(strUrl.indexOf("sort")==-1)
		{
			strUrl+="&sort=" +value2;
		}
		else{
			strUrl=strUrl.split('sort=');
			var url="";
			 if(strUrl[1].indexOf("&")>-1)
				 {
				 	url=strUrl[1].substring(strUrl[1].indexOf("&"));
				 }
				strUrl= strUrl[0] + "sort="+ value2 + url;
		}
		window.location.href=strUrl;
		
		break;
		
		case "mode2":
		if(strUrl.indexOf("desc")==-1)
		{
			strUrl+="&desc=" +value2;
		}
		else
		{
			strUrl=strUrl.split('desc=');
			var url="";
			 if(strUrl[1].indexOf("&")>-1)
				 {
				 	url=strUrl[1].substring(strUrl[1].indexOf("&"));
				 }
				strUrl= strUrl[0] + "desc="+ value2 + url;
		}
		 window.location.href=strUrl;
		break;
		
		
		case "mode3":
			if(strUrl.indexOf("item_pg")==-1)
			 strUrl+="&item_pg=" +value2;
			 else
			 {
				strUrl=strUrl.split('item_pg=');
				 var url="";
			
				 if(strUrl[1].indexOf("&")>-1)
				 {
				 	url=strUrl[1].substring(strUrl[1].indexOf("&"));
				 }
				strUrl= strUrl[0] + "item_pg="+ value2 + url;	
			 }
			 
			
			 
			 if(strUrl.indexOf("page")!=-1)
			 {
			
			    	strUrl=strUrl.split('page=');
				 var url1="";
			
				 if(strUrl[1].indexOf("&")>-1)
				 {
				 	url1=strUrl[1].substring(strUrl[1].indexOf("&"));
				 }

				strUrl= strUrl[0] + "page=1" + url1;	
			 }

			 window.location.href=strUrl;			
		break;
		
	}
}

function checkRegister(e)
{
    if(e.checked)
        document.getElementById("butreg_1").disabled=false;
    else
        document.getElementById("butreg_1").disabled=true;
        
}

function AgreeRegister()
{
    document.getElementById("divRegister").style.display="none";
    document.getElementById("divInformationRegister").style.display="block";
    
}

