var Mods="&hidEngine=false&hidVehicle=false&hidSearch=false"
var cUrl="http://demo.estore.catalograck.com"
setDciSearch();
setDciVehicleModule();
setDciEngineModule();
setDciBrandModule();
	
function setDciSearch() 
{
	if (window.location.href.indexOf("?") > 0)
	{	
	
		var qs = window.location.href.substring(window.location.href.indexOf("?"),window.location.href.length);		
		var ifDciSearch = document.getElementById("ifDciSearch");		
		if (ifDciSearch != null)
		{
		    if (qs.indexOf("hdnUK") > 0)
		    {
		        ifDciSearch.src = cUrl + "/v5/Members/lookups/Default.asp" + qs + Mods;
		    }
		    else
		    {
				ifDciSearch.src = cUrl + "/default.asp" + qs + Mods;
		    }			
		}
	}
	else
	{			
		var ifDciSearch = document.getElementById("ifDciSearch");	
		if (ifDciSearch != null)	
			ifDciSearch.src = cUrl + "/default.asp?XYZ=" + Mods;		
	}
}


function setDciVehicleModule() 
{		

	if (window.location.href.indexOf("?") > 0)
	{		
		var qs = window.location.href.substring(window.location.href.indexOf("?"),window.location.href.length);		
		var ifVehicleModule = document.getElementById("ifVehicleModule");
		if (ifVehicleModule != null)
		{		  
		    if (qs.indexOf("hdnUK") > 0)
		    {
		        ifVehicleModule.src = cUrl + "/v5/Modules/VehicleModule.asp" + qs + Mods;
		    }
		    else
		    {		     
		        ifVehicleModule.src = cUrl + "/v5/Modules/Default.asp?Module=Vehicle" + Mods;
		    }	
		}		
	}
	else
	{			
		var ifVehicleModule = document.getElementById("ifVehicleModule");
		if (ifVehicleModule != null)
			ifVehicleModule.src = cUrl + "/v5/Modules/Default.asp?Module=Vehicle" + Mods;		
	}
}


function setDciEngineModule() 
{	  
	if (window.location.href.indexOf("?") > 0)
	{					
		var qs = window.location.href.substring(window.location.href.indexOf("?"),window.location.href.length);
		var ifEngineModule = document.getElementById("ifEngineModule");
		if (ifEngineModule != null)
		{
		    if (qs.indexOf("hdnUK") > 0)
		    {
			    ifEngineModule.src = cUrl + "/v5/Modules/EngineModule.asp" + qs + Mods;
			}
			else
			{
				ifEngineModule.src = cUrl + "/v5/Modules/Default.asp?Module=Engine" + Mods;
			}
		}
	}
	else
	{			
		var ifEngineModule = document.getElementById("ifEngineModule");
		if (ifEngineModule != null)
			ifEngineModule.src = cUrl + "/v5/Modules/Default.asp?Module=Engine" + Mods;
	}
}


function setDciBrandModule() 
{	  
	if (window.location.href.indexOf("?") > 0)
	{					
		var qs = window.location.href.substring(window.location.href.indexOf("?"),window.location.href.indexOf("hdnQ")-1);		
		var ifBrandModule = document.getElementById("ifBrandModule");
		if (ifBrandModule != null)	
		{	 			
		    if (qs.indexOf("hdnUK") > 0)
		    {
		        ifBrandModule.src = cUrl + "/v5/Modules/BrandModule.asp" + qs + Mods;
		    }
		    else
		    {
		        ifBrandModule.src = cUrl + "/v5/Modules/Default.asp?Module=Brand" + Mods;
		    }
		}
	}
	else
	{			
		var ifBrandModule = document.getElementById("ifBrandModule");
		if (ifBrandModule != null)
			ifBrandModule.src = cUrl + "/v5/Modules/Default.asp?Module=Brand" + Mods;
	}
}
	
	
	
function externalDciSearch(objSearch) 
{
    var txtSearch = document.getElementById(objSearch);   	
	window.parent.location = "http://catalograckestore.com/lookup.html?XYZ=" + Mods + "&tSearch=" + txtSearch.value;
}
	
	
