function getURLParam( name ){  
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
	var regexS = "[\\?&]"+name+"=([^&#]*)";  
	var regex = new RegExp( regexS );  
	var results = regex.exec( window.location.href );  
	if( results == null )    return "";  else    return results[1];
}

function pagingDetailHREF(pgNbr, pgCnt, pgVw, so, ki, pg, typId, sList){

	if(pgCnt == null || pgCnt == ""){
		pgCnt = "&pgCnt="+getURLParam("pgCnt");
	}else{
		pgCnt = "&pgCnt="+pgCnt;
	}		
	if(pgVw == null || pgVw == ""){
		pgVw = "&pgVw="+getURLParam("pgVw");					
	}else{
		pgVw = "&pgVw="+pgVw;
	}
	if(getURLParam("ki") == null || getURLParam("ki") == ""){
		ki = "&ki=";
	}else{
		ki = "&ki="+getURLParam("ki");
	}
	
	if(pg == null || pg == ""){
		pg = "";
	}else{
		pg = pg;
	}		
	
	if(so == null || so == ""){
		so = "&so="+getURLParam("so");
	}else{
		so = "&so="+so;
	}		

	if(pgNbr != ""){
		pgNbr = "&pgNbr="+pgNbr;
	}

	if(sList == null || sList == ""){
		sList = "";
	}else{
		sList = "&sList="+sList;				
	}	

	if(typId == null || typId == ""){
		typId = "";
	}else{
		typId = "&tId="+typId;				
	}	

	var strNavId = "&navId=";
	if(getURLParam("navId") == null || getURLParam("navId") == ""){
		strNavId = "&navId=";
	}else{
		strNavId = "&navId="+getURLParam("navId");
	}
	
	var productId = "pId=";
	if( getURLParam("pId")!= null || getURLParam("pId") != ""){
		productId = "pId="+getURLParam("pId");
	}else{
		productId = "pId=";	
	}		

	var attrIdDollar = "&at1=";
	if( getURLParam("at1")!= null || getURLParam("at1") != ""){
		attrIdDollar = "&at1="+getURLParam("at1");
	}else{
		attrIdDollar = "&at1=";	
	}						

	var attrIdSpace = "&at4=";
	if( getURLParam("at4")!= null || getURLParam("at4") != ""){
		attrIdSpace = "&at4="+getURLParam("at4");
	}else{
		attrIdSpace = "&at4=";	
	}		
			
	var appId = "&at5=";
	if( getURLParam("at5")!= null || getURLParam("at5") != ""){
		appId = "&at5="+getURLParam("at5");
	}else{
		appId = "&at5=";	
	}	

	return window.location = "/DotCom/jsp/designResources/typicalsResults"+ pg +".jsp?"+productId + strNavId + attrIdDollar + attrIdSpace + appId + pgNbr + pgCnt + pgVw + ki + so + sList + typId;
	//return window.location = "/DotCom/jsp/designResources/typicalsResults"+ pg +".jsp?"+productId + strNavId + attrIdDollar + attrIdSpace + appId + pgNbr + pgCnt + pgVw + ki + so + sList;
}

function pagingResultsHREF(pgNbr, pgCnt, pgVw, so, ki, pg, typId, sList){

	if(pgCnt == null || pgCnt == ""){
		pgCnt = "&pgCnt="+getURLParam("pgCnt");
	}else{
		pgCnt = "&pgCnt="+pgCnt;
	}		
	if(pgVw == null || pgVw == ""){
		pgVw = "&pgVw="+getURLParam("pgVw");					
	}else{
		pgVw = "&pgVw="+pgVw;
	}
	if(getURLParam("ki") == null || getURLParam("ki") == ""){
		ki = "&ki=";
	}else{
		ki = "&ki="+getURLParam("ki");
	}
	
	if(pg == null || pg == ""){
		pg = "";
	}else{
		pg = pg;				
	}		

	if(sList == null || sList == ""){
		sList = "";
	}else{
		sList = "&sList="+sList;				
	}	
	
	if(so == null || so == ""){
		so = "&so="+getURLParam("so");
	}else{
		so = "&so="+so;
	}		

	if(typId == null || typId == ""){
		typId = "";
	}else{
		typId = "&tId="+typId;				
	}	
	
	var strNavId = "&navId=";
	if(getURLParam("navId") == null || getURLParam("navId") == ""){
		strNavId = "&navId=";
	}else{
		strNavId = "&navId="+getURLParam("navId");
	}	
	
	var productId = "pId=";
	if(document.getElementById('searchProduct').value != "Choose..."){
		productId = "pId="+document.getElementById('searchProduct').value;
	}		

	var attrIdDollar = "&at1=";
	if(	document.getElementById('searchListPrice').value != "Choose..."){
		attrIdDollar = "&at1=" + document.getElementById('searchListPrice').value;
	}				

	var attrIdSpace = "&at4=";
	if(document.getElementById('searchSquareFeet').value != "Choose..."){
		attrIdSpace = "&at4=" + document.getElementById('searchSquareFeet').value;
	}
			
	var appId = "&at5=";
	if(document.getElementById('searchApplication').value != "Choose..."){
		appId = "&at5=" + document.getElementById('searchApplication').value;
	}

	if(pgNbr != ""){
		pgNbr = "&pgNbr="+pgNbr;
	}
	return window.location = "/DotCom/jsp/designResources/typicalsResults"+ pg +".jsp?"+productId + strNavId + attrIdDollar + attrIdSpace + appId + pgNbr + pgCnt + pgVw + ki + so + sList + typId;
	//return window.location = "/DotCom/jsp/designResources/typicalsResults"+ pg +".jsp?"+productId + strNavId + attrIdDollar + attrIdSpace + appId + pgNbr + pgCnt + pgVw + ki + so + sList;
}

function buildSearchHREF(strNavId){
//&pgNbr=1&pgCnt=25&pgVw=Dv
	var pgNbr = "&pgNbr=1";
	var pgCnt = "&pgCnt=25";
	var pgVw = "&pgVw=Iv";
	var ki = "&ki=";
	var so = "&so=";
	
	if(getURLParam("pgCnt")== null || getURLParam("pgCnt") == ""){
		pgCnt;
	}else{
		pgCnt = "&pgCnt="+getURLParam("pgCnt");
	}		
	if(getURLParam("pgVw")== null || getURLParam("pgVw") == ""){
		pgVw;
	}else{
		pgVw = "&pgVw="+getURLParam("pgVw");
	}	

	if(getURLParam("ki") == null || getURLParam("ki") == ""){
		ki;
	}else{
		ki = "&ki="+getURLParam("ki");
	}
	
	if(getURLParam("so") == null || getURLParam("so") == ""){
		so;
	}else{
		so = "&so="+getURLParam("so");
	}		
	
	if(strNavId == null || strNavId == ""){
		strNavId = "&navId=";
	}else{
		strNavId = "&navId="+strNavId;
	}
	
	var productId = "pId=";
	if(document.getElementById('searchProduct').value != "Choose..."){
		productId = "pId="+document.getElementById('searchProduct').value;
	}		

	var attrIdDollar = "&at1=";
	if(	document.getElementById('searchListPrice').value != "Choose..."){
		attrIdDollar = "&at1=" + document.getElementById('searchListPrice').value;
	}				

	var attrIdSpace = "&at4=";
	if(document.getElementById('searchSquareFeet').value != "Choose..."){
		attrIdSpace = "&at4=" + document.getElementById('searchSquareFeet').value;
	}
			
	var appId = "&at5=";
	if(document.getElementById('searchApplication').value != "Choose..."){
		appId = "&at5=" + document.getElementById('searchApplication').value;
	}		
	//alert("/DotCom/jsp/designResources/typicals.jsp?prodId="+productId+"&adr="+attrIdDollar+"&asr="+attrIdSpace+"&appId="+appId);
	return window.location = "/DotCom/jsp/designResources/typicalsResults.jsp?"+productId + strNavId + attrIdDollar + attrIdSpace + appId + pgNbr + pgCnt + pgVw + ki + so;
}