function goff(IDD){
if(IDD > 0)document.getElementById("searchResultsDiv"+IDD).innerHTML = "";
else document.getElementById("searchResultsDiv").innerHTML = "";

} 
function suggestOver2(div_value) {
	div_value.className = 'suggest_link_over';
}
//Mouse out function
function suggestOut2(div_value) {
	div_value.className = 'suggest_link';
}

function getit3(ID,vari,se){

sauceform['votes['+ID+']['+vari+']'].value=se;
document.getElementById("searchResultsDiv"+ID).innerHTML = "";

}

function aFuncrc(IDD,vari)
  {
  var xmlHttp;
  
  var se = sauceform['votes['+IDD+']['+vari+']'].value;
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {      
		document.getElementById('searchResultsDiv'+IDD).innerHTML = xmlHttp.responseText;
		//alert(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/advancedsearch.php?IDD="+IDD+"&vari="+vari+"&sendit3=1&searched="+se,true);
    xmlHttp.send(null);
  }
  

function tmv(hoveritem)
{

//var w= pageWidth() - 1009 / 2;
var w= pageWidth();

w = (w - 1009) /2;

hp = document.getElementById("search");
hpb = document.getElementById("searchpanel");

w= w + hp.offsetLeft;

//alert(hp.offsetLeft);

// Set position of hover-over popup
hpb.style.top = 22;
hpb.style.left = w;

toggleIt2('searchpanel');
untoggleIt('search');

}

function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} 

function mouseover2(thediv)
{
document.getElementById(thediv).style.backgroundColor='#e8eccf';
document.getElementById(thediv).style.borderColor='#96a924';
}
function mouseout2(thediv)
{
document.getElementById(thediv).style.backgroundColor='#f6f6f4';
document.getElementById(thediv).style.borderColor='#e8e8e2';
} 


function Start(page) {
OpenWin = this.open("http://www.saucemagazine.com/"+page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,height=375,width=350");
}


function StartSlide(page) {
OpenWin = this.open("http://www.saucemagazine.com/"+page, "CtrlWindow", "toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no,height=650,width=420");
}

function toggleIt2( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}


function toggleIt( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
  
  
var aryVals = [1,2,4,5,8,10,11,14,16,17];
for (i=0;i<aryVals.length;i++){
if(aryVals[i] == whichLayer) {

}else untoggleIt(aryVals[i]);
}

}

function untoggleIt( whichLayer )
{
  var elem, vis;
  
  if(document.getElementById(whichLayer)){
  
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;

  vis.display = 'none';
  }
}


function toggleIt3( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;

  vis.display = 'block';
}





function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function Inj(namediv,divvalue){

document.getElementById(namediv).innerHTML=divvalue;
}

function changestars(num){

var number="";

for (i=1;i<=num;i++){

number=i+"star";

document.getElementById(number).src='/siteimgs/img_starRED.gif';

}

}

function releasestars(){

var number="";

for (i=1;i<=5;i++){

number=i+"star";

document.getElementById(number).src='/siteimgs/img_starGRAY.gif';

}

}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function getVid(vid)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		
        startVid(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/media.php?st="+vid,true);
    xmlHttp.send(null);
  }
  
 
function getVid3(vid)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		
        startVid3(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/media.php?st="+vid,true);
    xmlHttp.send(null);
  }
  
function loadvid(id)
  {
  	IDA=id;
  var s2 = new SWFObject("/mediaplayer2.swf","playlist","320","200","8","#ffffff");
	s2.addParam("allowfullscreen","false");
	s2.addVariable('linkfromdisplay', 'true');
	s2.addVariable('linktarget',"_self");
	s2.addVariable("showdigits","total");	
	s2.addVariable("shuffle","false");
	s2.addVariable("file","/saucevids30.php?saucev="+id);
	s2.addVariable("displayheight","180");
	s2.addVariable("displaywidth","320");
	s2.addVariable("width","320");
	s2.addVariable("height","200");
	s2.addVariable("frontcolor","0x000000");
	s2.addVariable("lightcolor","0x333333");	
	s2.addVariable("screencolor","0x00000");
	s2.addVariable("autostart","false");
	s2.addVariable("bufferlength","15");
	s2.addVariable("thumbsinplaylist","false");
	s2.addVariable('enablejs', 'true'); // JavaScript so the magic happens
	s2.addVariable('javascriptid', 'mpl');
	s2.addVariable("repeat","list");
	s2.write("player2");
  }
  
  function startVid(startFile){
	var s2 = new SWFObject("http://www.saucemagazine.com/mediaplayer.swf","playlist","473","200","9","#ffffff");
	s2.addParam("allowfullscreen","false");
	s2.addVariable("shuffle","false");	
	s2.addParam("wmode","opaque");
	s2.addVariable("showdigits","total");	
	s2.addVariable("file",startFile);
	s2.addVariable("displayheight","180");
	s2.addVariable("displaywidth","304");
	s2.addVariable("width","473");
	s2.addVariable("height","200");
	s2.addVariable("backcolor","0xffffff");
	s2.addVariable("frontcolor","0x000000");
	s2.addVariable("lightcolor","0x333333");	
	s2.addVariable("screencolor","0x00000");
	s2.addVariable("autostart","false");
	s2.addVariable("bufferlength","15");
	s2.addVariable("showicons","true");
	s2.addVariable("thumbsinplaylist","true");
	s2.addVariable('linkfromdisplay','true');
	s2.write("player2");

}

  function startVid3(startFile){
	var s2 = new SWFObject("http://www.saucemagazine.com/mediaplayer.swf","playlist","473","200","9","#ffffff");
	s2.addParam("allowfullscreen","false");
	s2.addVariable("shuffle","false");	
	s2.addParam("wmode","opaque");
	s2.addVariable("showdigits","total");	
	s2.addVariable("file",startFile);
	s2.addVariable("displayheight","180");
	s2.addVariable("displaywidth","304");
	s2.addVariable("width","473");
	s2.addVariable("height","200");
	s2.addVariable("backcolor","0xffffff");
	s2.addVariable("frontcolor","0x000000");
	s2.addVariable("lightcolor","0x333333");	
	s2.addVariable("screencolor","0x00000");
	s2.addVariable("autostart","false");
	s2.addVariable("bufferlength","15");
	s2.addVariable("showicons","true");
	s2.addVariable('linkfromdisplay','true');
	s2.write("player2");

}


function getPics(aid,i)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
		var adata=xmlHttp.responseText;
        document.getElementById('articlepicscontainer').innerHTML =adata;
		var alength=adata.length;
		var tadata=(alength-642)/100;
		var tnum=tadata*20+220;

document.getElementById('articlepicscontainer').style.height= tnum+'px';
		}
      }
	  
	  var queryString = encodeURI("?i="+i+"&aid="+aid+"&dummy=" + new Date().getTime());	
    xmlHttp.open("GET","/aimg.php" + queryString,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=iso-8859-1");
    xmlHttp.send(null);
  }
  
  
  function textLimit(field, maxlen) {
if (field.value.length > maxlen)
alert('You have reached your 500 character maximum! No more characters allowed.');
if (field.value.length > maxlen)
field.value = field.value.substring(0, maxlen);
}


function aFunction(vid)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        startit(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/media.php?sv="+vid,true);
    xmlHttp.send(null);
  }
  
  
  function aFunction2(vid)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
	       startit(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/media.php?srv="+vid,true);
    xmlHttp.send(null);
  }
  
  
  
  function aFunction2small(vid)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        startitsmall(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/media.php?srv="+vid,true);
    xmlHttp.send(null);
  }
  
  function aFunction3(vid)
  {
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        startit(xmlHttp.responseText);
		}
      }
    xmlHttp.open("GET","/media.php?stv="+vid,true);
    xmlHttp.send(null);
  }
  
  function startit(startFile){
	var s2 = new SWFObject("mediaplayer.swf","playlist","480","290","7","#ffffff");
	s2.addParam("allowfullscreen","true");
	s2.addVariable("shuffle","false");	
	s2.addVariable("showdigits","total");	
	s2.addVariable("file",startFile);

	s2.addVariable("backcolor","0xffffff");
	s2.addVariable("frontcolor","0x000000");
	s2.addVariable("lightcolor","0x333333");	
	s2.addVariable("screencolor","0x00000");
	
	s2.addVariable("autostart","true");
	s2.addVariable("bufferlength","15");
	s2.addVariable("showicons","true");
	s2.addVariable("thumbsinplaylist","true");
	s2.write("player2");
	
}

  function startitsmall(startFile){
	var s2 = new SWFObject("/mediaplayer.swf","playlist","240","145","7","#000000");
	s2.addParam("allowfullscreen","true");
	s2.addVariable("shuffle","false");	
	s2.addVariable("showdigits","total");	
	s2.addVariable("file",startFile);

	s2.addVariable("backcolor","0xffffff");
	s2.addVariable("frontcolor","0x000000");
	s2.addVariable("lightcolor","0x333333");	
	s2.addVariable("screencolor","0x00000");
	
	s2.addVariable("autostart","false");
	s2.addVariable("bufferlength","15");
	s2.addVariable("showicons","true");
	s2.addVariable("thumbsinplaylist","true");
	s2.write("player2");
	
}

function showicons(val)
  {
  
  var type;
  

  
  showgiftvalue(val);
  

if (document.giftform.only25.checked) type == 1;
else type=0;
  
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('showimgs').innerHTML =xmlHttp.responseText;
		}
      }
    xmlHttp.open("GET","/myfuncs.php?usethis="+val+"&only25="+type+"&dummy=" + new Date().getTime(),true);
    xmlHttp.send(null);
	
  }
  
function showgiftvalue(val)
  {
  
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('yourorder').innerHTML =xmlHttp.responseText;
		}
      }
    xmlHttp.open("GET","/myfuncs.php?showvaluegift="+val+"&dummy=" + new Date().getTime(),true);
    xmlHttp.send(null);
	
  }
  
  function imgchange(imgid){
		showgifttype(imgid);
		var si = "imgs/SC"+imgid+"l.gif";	
		//var si =  document.frm.selbox.selectedIndex;
        //var fname = document.frm.selbox.options[si].value
        document.img.src = si
}




function showgifttype(val)
  {
  
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('yourorder').innerHTML =xmlHttp.responseText;
		}
      }
    xmlHttp.open("GET","/myfuncs.php?gifttype="+val+"&dummy=" + new Date().getTime(),true);
    xmlHttp.send(null);
	
  }
  
  
function rate(val,thisid,cat)
  {
  //alert('test');
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('yourrate').innerHTML =xmlHttp.responseText;
		}
      }
    xmlHttp.open("GET","/myfuncs.php?rt="+val+"&se="+thisid+"&ch="+cat+"&dummy=" + new Date().getTime(),true);
    xmlHttp.send(null);
	
  }
  
  
  
function showdaily(val)
  {
  
  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)
        {
        alert("Your browser does not support AJAX!");
        return false;
        }
      }
    }
    xmlHttp.onreadystatechange=function()
      {
      if(xmlHttp.readyState==4)
        {
        document.getElementById('dailydata').innerHTML =xmlHttp.responseText;
		}
      }
    xmlHttp.open("GET","http://www.thedailysauce.com/show_html_30.php&dummy=" + new Date().getTime(),true);
    xmlHttp.send(null);
	
  }
  
  
  function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

function Mailto(nm,aid)   
{
	// Used to id browsers.
	var browser="";
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==2) { browser="n2"; }
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==3) { browser="n3"; }
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==4) { browser="n4"; }
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==5) { browser="n5"; }
	if(navigator.appVersion.indexOf("MSIE 3.0") != -1) { 	browser="ie3"; }
	if(navigator.appVersion.indexOf("MSIE 4.0") != -1) { 	browser="ie4"; }
	if(navigator.appVersion.indexOf("MSIE 5.0") != -1) { 	browser="ie5"; }


	// Position the window if we're in netscape 4
	var w=0;
	var h=0;
	if ( browser=="n4" )
	{
		var screen_height=parent.screen.height;
		var screen_width=parent.screen.width;
		var main_height=parent.window.innerHeight;
		w=(screen_width/2)-300;
	}

	var newWind = 
	window.open("http://www.saucemagazine.com/contactus.php?c="+nm+"&aid="+aid,
	"display",
	"width=400,height=375,screenX="+w+",screenY="+h);

	if (newWind.opener == null) {
		newWind.opener = window;
	} else {
		if ( browser=="n3"  ||  browser=="n4"  ||  browser=="ie4"  ||  browser=="ie5")
			newWind.focus();
	}   
}

function urlencode(str) {
return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}



function winOpen()   
{
	// Used to id browsers.
	var browser="";
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==2) { browser="n2"; }
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==3) { browser="n3"; }
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==4) { browser="n4"; }
	if(navigator.appName=="Netscape" && 	parseInt(navigator.appVersion)==5) { browser="n5"; }
	if(navigator.appVersion.indexOf("MSIE 3.0") != -1) { 	browser="ie3"; }
	if(navigator.appVersion.indexOf("MSIE 4.0") != -1) { 	browser="ie4"; }
	if(navigator.appVersion.indexOf("MSIE 5.0") != -1) { 	browser="ie5"; }


	// Position the window if we're in netscape 4
	var w=0;
	var h=0;
	if ( browser=="n4" )
	{
		var screen_height=parent.screen.height;
		var screen_width=parent.screen.width;
		var main_height=parent.window.innerHeight;
		w=(screen_width/2)-300;
	}
	
	var URLVALUE = urlencode(document.URL);


	var newWind = 
	window.open("http://www.saucemagazine.com/friend.php?ARTICLE=" +
	URLVALUE,
	"display",
	"width=525,height=415,screenX="+w+",screenY="+h);

	if (newWind.opener == null) {
		newWind.opener = window;
	} else {
		if ( browser=="n3"  ||  browser=="n4"  ||  browser=="ie4"  ||  browser=="ie5")
			newWind.focus();
	}   
}
