// Function Store Search
// Use: Prepares String For Yahoo Query
// Called With: Yahoo Storeid & Search String
// Returns: Redirects to Yahoo Store Search


function makeand(querystring) {
 querywords = querystring.split(" ");
 var finalquery = "";
 
 // Search Must Contain All Words
 for (var lp=0; lp < querywords.length; lp++) {
   finalquery = finalquery+" +"+querywords[lp];
  }
 
  // Launch Search Page
 return finalquery;
}

function storesearch(querystring) {
 querywords = querystring.split(" ");
 var finalquery = "";
 
 // Search Must Contain All Words
 for (var lp=0; lp < querywords.length; lp++) {
   finalquery = finalquery+"+%2B"+querywords[lp];
  }
 
  // Launch Search Page
 document.location.href="http://search.store.yahoo.com/cgi-bin/nsearch?catalog=laptop-saver&query="+finalquery;
}

// Function GETID
// Returns a Somewhat Random Number
function getid() {
Stamp = new Date();
document.write(Stamp.getMonth()+"1"+ Stamp.getHours() +"A"+ Stamp.getDate() +"X"+ "0587" + "P"+  Stamp.getMinutes());
} ;

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}

function y_svi (xcode) {
	aok=getCookie('y_svi');
	if (aok!=null && aok!=""){
		xcode = xcode.substr(10,xcode.length-20); 
		var outstr = "";
		for (i = 0; i < xcode.length; i=i+2)
		{
			outstr = outstr + "%" + xcode.substr(i,2);
		}
		document.write(decodeURI(outstr));
	} else {
		
	}
}

