function GetQueryString(strLocation) {
	var strURL = strLocation.toString();
	var qIndex = strURL.indexOf('?');
//	alert(strURL.substring(qIndex + 1));
	if (qIndex == -1) {
		return "";
	} else {
		return strURL.substring(qIndex + 1);
	}
}


function setCookie()
{
  	var cookieValue = "";
   cookieValue =getCookieName();
  // alert("cookieValue-"+cookieValue);
	var expires = "";
	if(cookieValue!="" && document.cookie=="")
	{
		    var cookieValue1 = cookieValue.split(";");
   			document.cookie =cookieValue1[0];	
		   return (document.cookie);
	}	
	if(document.cookie!="")
	{
	    cookieValue = document.cookie;
		var cookieValue1 = cookieValue.split(";");
   		document.cookie =cookieValue1[0];
		// alert(document.cookie);
		return (document.cookie); 
	}
	else
	{
	  return "";
	}
		
}	
	function getCookieName()
{
 
     var strQueryString ="";
	var ppcIndex=-1;
	var andAfterIndex=-1;
	strQueryString = GetQueryString(document.location);	
//	alert("strQueryString-"+strQueryString);
	
	if(strQueryString=="")
	{
	  return "";
	}
	else
	{   
	    ppcIndex =strQueryString.indexOf('ppcid'); 
	    if (ppcIndex == -1)
		{
			return "";
		}
		else 
		{
		    andAfterIndex =strQueryString.indexOf('&'); 
		    if(andAfterIndex==-1)
			{
				return strQueryString.substring(ppcIndex + 6);
			}
			else
			{
			  var queryString = strQueryString.split("&");
			  var len =queryString.length;
			  var i =0;
			  while(i<len)
              {			  
			        
					if(queryString[i].indexOf('ppcid')>-1 )
					{
				  		strQueryString=queryString[i];
				  		break;
					}
			    	i=i+1;			 				
			  }
			  ppcIndex =strQueryString.indexOf('ppcid'); 
			  return strQueryString.substring(6);	
			} 
		}
	    
	} 
	
}	

	


var a=setCookie()
function assignCookieValue()
{
	var a=setCookie();
	
	cookieValue = a.split(";");
	//alert(cookieValue[0]);
	document.form1.hidden.value = cookieValue[0];
}	