// Vaibhav-Eclat, 09-13-08
// AJAX Request Scirpt
// create array of products
for(var pp=1;pp<=proCount;pp++)
{ 
	productStr = productStr +  proIds.get(pp) + "|";
	//alert(productStr);
}
//alert(productStr);
// create array of manufacturers
for(var mm=1;mm<=mfrCount;mm++)
{ 
	manufacturerStr = manufacturerStr +  mfrIds.get(mm) + "|";
}
//alert(productStr);
// if there is any product or manufacturer then
//alert(proCount);
if(proCount > 0 || mfrCount > 0 )
{
	// AJAX Request
	var xmlHttp;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		// Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
			}
		}
	}
    xmlHttp.onreadystatechange=function()
    {
		if(xmlHttp.readyState==4)
		{
		}
    }
	//xmlHttp.open("GET","http://www.toydirectory.com/monthly/tracking/trackingMfr.asp?url="+window.location.href+"&cId="+contentId+"&cType="+contentType+"&pid="+productStr+"&pcount="+proCount+"&mid="+manufacturerStr+"&mcount="+mfrCount,true);
  	xmlHttp.open("GET","http://www.toydirectory.com/monthly/tracking/trackingMfr.asp?url="+escape(window.location.href)+"&cId="+contentId+"&cType="+contentType.replace(/&/g, " And ")+"&cg_id="+content_group_id+"&pid="+productStr+"&pcount="+proCount+"&mid="+manufacturerStr+"&mcount="+mfrCount,true);
	//window.open("http://www.toydirectory.com/monthly/tracking/trackingMfr.asp?url="+window.location.href+"&cId="+contentId+"&cType="+contentType+"&pid="+productStr+"&pcount="+proCount+"&mid="+manufacturerStr+"&mcount="+mfrCount,'mywindow','width=400,height=200');
	//window.open("http://localhost/monthly/tracking/trackingMfr.asp?url="+window.location.href+"&cId="+contentId+"&cType="+contentType+"&pid="+productStr+"&pcount="+proCount+"&mid="+manufacturerStr+"&mcount="+mfrCount,'mywindow','width=400,height=200');
	xmlHttp.send(null);	
}

function callFunction(proCount,proIds,mfrCount,mfrIds,contentId,contentType,content_group_id)
{	
	var productStr = "";
	var manufacturerStr = "";
	for(var pp=1;pp<=proCount;pp++)
	{ 
		productStr = productStr +  proIds.get(pp) + "|";
		//alert(productStr);
	}
	//alert(productStr);
	// create array of manufacturers
	for(var mm=1;mm<=mfrCount;mm++)
	{ 
		manufacturerStr = manufacturerStr +  mfrIds.get(mm) + "|";
	}
	//alert(manufacturerStr);
	// if there is any product or manufacturer then
	//alert(proCount);
	if(proCount > 0 || mfrCount > 0 )
	{
		// AJAX Request
		var xmlHttpNew;
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttpNew=new XMLHttpRequest();
		}
		catch (e)
		{
			// Internet Explorer
			try
			{
				xmlHttpNew=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				try
				{
					xmlHttpNew=new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch (e)
				{	
				}
			}
		}
		xmlHttpNew.onreadystatechange=function()
		{
			if(xmlHttpNew.readyState==4)
			{
			}
		}
		xmlHttpNew.open("GET","http://www.toydirectory.com/monthly/tracking/trackingMfr.asp?url="+escape(window.location.href)+"&cId="+contentId+"&cType="+contentType.replace(/&/g, " And ")+"&cg_id="+content_group_id+"&pid="+productStr+"&pcount="+proCount+"&mid="+manufacturerStr+"&mcount="+mfrCount,true);
		xmlHttpNew.send(null);	
	}
}

//alert("End");