	var CampaignID = -1;

	function EvaluateCampaign()

	{

		// code for IE

		if (window.ActiveXObject)

		{

			

			EvaluateCampaign_IE();

		}

		// code for Mozilla, etc.

		else //if(window.xmlhttpRequest) 

		{

			EvaluateCampaign_NOTIE();

		}

	}





        function handleResponse(msg)

        {

          //alert('In the main Frame');

          //alert(msg);

        }





//	var mozzilaRelatedId = -9999;

	function EvaluateCampaign_NOTIE()

	{

                 //alert('Not IE');	



                 var location = "http://www.luxaris.com/campaigner/RefMozzila.aspx?InitialCall=1&FireFox=True&";



		    var CampaignID = readCookie("CampaignID");

		    

		    if (CampaignID == null)

		    {

                        //alert('No cookie');

                        createCookie("CampaignID",mozzilaRelatedId ,30);

                        CampaignID = readCookie("CampaignID");

           }

           //alert('here');

           var obj = document.getElementById('CampaignId');

           obj.innerHTML = CampaignID;

document.getElementById("refference").setAttribute("value",CampaignID);

           

           //alert(document.getElementsByName('CampaignID').length);

//           alert(document.getElementById('CampaignID'));

//			document.getElementsByName(""CampaignID")

//           document.getElementById('CampaignID').innerHTML = CampaignID;



                 callToServer(location,CampaignID  );



/*



			var version; 

		    var xmlhttp = new XMLHttpRequest(); 

		    

		    var CampaignID = readCookie("CampaignID");

		    

		    if (CampaignID == null)

		    {

//			    //alert(xmlhttp);	

        

				xmlhttp.open("GET", "http://www.luxaris.com/campaigner/RefLogger.aspx?InitialCall=1&FireFox=True&", false); 

				xmlresult = xmlhttp.send(null); 

//				alert(xmlhttp.responseText);

				createCookie("CampaignID",xmlhttp.responseText,0);

				//version = xmlhttp.responseXML.getElementsByTagName('version')[0].firstChild.nodeValue; 

				value = readCookie("CampaignID");

//				//alert(value);

			}

			else

			{

//				alert('Cookie Found');

//				alert(document.getElementById("CampaignID"));

//				alert(readCookie("CampaignID"));

				document.getElementById("CampaignID").innerHTML = readCookie("CampaignID");

			}

*/

		

		}



function callToServer(URL,CampaignID ) {

	if (!document.createElement) {return true};

	var IFrameDoc;

var IFrameObj;

//	var URL = 'server.html';



       // alert('starting Call to server');



	if (!IFrameObj && document.createElement) {

		// create the IFrame and assign a reference to the

		// object to our global variable IFrameObj.

		// this will only happen the first time 

		// callToServer() is called

		try {

			var tempIFrame=document.createElement('iframe');

			tempIFrame.setAttribute('id','RSIFrame');

			tempIFrame.style.border='3px';

			tempIFrame.style.width='0px';

			tempIFrame.style.height='0px';

			IFrameObj = document.body.appendChild(tempIFrame);

			

			if (document.frames) {

				// this is for IE5 Mac, because it will only

				// allow access to the document object

				// of the IFrame if we access it through

				// the document.frames array

				IFrameObj = document.frames['RSIFrame'];

			}

		} catch(exception) {

			// This is for IE5 PC, which does not allow dynamic creation

			// and manipulation of an iframe object. Instead, we'll fake

			// it up by creating our own objects.

			iframeHTML='<iframe id="RSIFrame" style="';

			iframeHTML+='border:3px;';

			iframeHTML+='width:200px;';

			iframeHTML+='height:200px;';

			iframeHTML+='"><\/iframe>';

			document.body.innerHTML+=iframeHTML;

			IFrameObj = new Object();

			IFrameObj.document = new Object();

			IFrameObj.document.location = new Object();

			IFrameObj.document.location.iframe = document.getElementById('RSIFrame');

			IFrameObj.document.location.replace = function(location) {

				this.iframe.src = location;

			}

		}

	}

	

	if (navigator.userAgent.indexOf('Gecko') !=-1 && !IFrameObj.contentDocument) {

		// we have to give NS6 a fraction of a second

		// to recognize the new IFrame

		setTimeout('callToServer()',10);

		return false;

	}

	

	if (IFrameObj.contentDocument) {

		// For NS6

		IFrameDoc = IFrameObj.contentDocument; 

	} else if (IFrameObj.contentWindow) {

		// For IE5.5 and IE6

		IFrameDoc = IFrameObj.contentWindow.document;

	} else if (IFrameObj.document) {

		// For IE5

		IFrameDoc = IFrameObj.document;

	} else {

		return true;

	}



	//alert('IframeSrc= ' + URL + '&CampaignID='+ CampaignID + '&' + document.referrer);
var url=URL + '&CampaignID='+ CampaignID + '&' + escape(document.referrer)+';'+escape(window.location);
url=url.substring(0,1000);
	IFrameDoc.location.replace(url);
	//IFrameDoc.location.replace(URL + '&CampaignID='+ CampaignID + '&' + document.referrer);

	return false;

}



















	function EvaluateCampaign_IE()

	{

			//alert("Here");

			CampaignID = readCookie("Campaign");

			if(CampaignID == null)

			{

				

				

				//alert('No cookie, calling scripting');

				

				

				document.getElementById("RefNumber").setAttribute("src","http://www.luxaris.com/campaigner/RefLogger.aspx?InitialCall=1&" + document.referrer);                    

			}

			else

			{

			

				document.getElementById("CampaignID").innerText = CampaignID;

				//alert("Setting Reference");

				document.getElementById("refference").innerText = CampaignID;



				//setTimeout("SetValue()",1000);

				

				//alert(CampaignID);

				//alert("Done!");

			}

		}

		function addLoadEvent(func)

		{    

			var oldonload = window.onload;

			if (typeof window.onload != 'function')

			{

				window.onload = func;

			} 

			else 

			{

				window.onload = function()

				{

					oldonload();

					func();

				}

			}

		}



		function SetValue()

		{

			//alert('Cookie found!');

			//alert("Setting Value");

			//alert(CampaignID);

			window.onload

			



		}

    

    

    function createCookie(name,value,days) {

	

	



        //alert('Creating cookie!');    

        

		

		

	    if (days) {

		    var date = new Date();

		    date.setTime(date.getTime()+(days*24*60*60*1000));

		    var expires = "; expires="+date.toGMTString();

	    }

	    else var expires = "";

	    document.cookie = name+"="+value+expires+"; path=/";

    }



    function readCookie(name) {

	

	

    

		//alert('Reading cookie!');   

		

		 

    

	    var nameEQ = name + "=";

	    var ca = document.cookie.split(';');

	    for(var i=0;i < ca.length;i++) {

		    var c = ca[i];

		    while (c.charAt(0)==' ') c = c.substring(1,c.length);

		    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);

	    }

	    return null;

    }



    function eraseCookie(name) {

	    createCookie(name,"",-1);

    }



	addLoadEvent(EvaluateCampaign);



    //setTimeout("EvaluateCampaign();",500);







function DoSearch()

{



	//alert(document.getElementById("SearchString"));

	//alert(	document.getElementById("SearchString").value);

	var searchBox = document.getElementById("SearchString").value;

	var url = "http://search.store.yahoo.com/cgi-bin/nsearch?catalog=yhst-40805406650437&query=" + searchBox;

	

	window.location.href = url;



}