var agt=navigator.userAgent.toLowerCase();
var is_ie   = (agt.indexOf("msie") != -1);

function vendorNotes(str) 
{
	//if window already opened close it, then open new one 
  if ((window.winHandle) && (!window.winHandle.closed) && (is_ie)) 
  {
  window.winHandle.close();
  }
 //open new window
	winHandle = window.open("http://www.gamesegment.com/popups/amazondetails.cfm?d="+str,'win2','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=450,height=150,left=440,top=440,screenX=440,screenY=440');

//do this to make sure its not open in background
winHandle.focus()

}


function popup(url) 
{
		if(url.indexOf("gamecards/")!=-1)
			winheight=500;
		else
			winheight=300;	
	
	//if window already opened close it, then open new one 
  if ((window.winHandle) && (!window.winHandle.closed) && (is_ie)) 
  {
  window.winHandle.close();
  }
 //open new window
	winHandle = window.open(url,"win2",'toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=400,height='+winheight+',left=100,top=40,screenX=100,screenY=40');

//do this to make sure its not open in background
winHandle.focus()

}

function goLink(dest,which,ref){
                i = new Image();
                s = Math.round(1E10*Math.random());
                i.src='http://www.gamesegment.com/link/external.cfm?dest='+dest+'&which='+which+'&ref='+ref+'&r='+s;
		
			return true;   
    }

function popuparticle(url,w,h) 
{
	
	
		//if window already opened close it, then open new one 
	  if ((window.winHandle) && (!window.winHandle.closed) && (is_ie)) 
	  {
	  window.winHandle.close();
	  }
	 //open new window
		winHandle = window.open(url,"win2",'toolbar=0,addressbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width='+w+',height='+h+',left=100,top=40,screenX=100,screenY=40');
	
	//do this to make sure its not open in background
	winHandle.focus()
	//winHandle.document.getElementsByTagName('body')[0].visibility=false;
}


function clearit()
{
	window.status='';
}

function set(text)
{
	window.status=text;
}

function bookmark()
{

	i = new Image();
	s = Math.round(1E10*Math.random());
	//store bookmark
	i.src='http://www.gamesegment.com/link/bookmark.cfm?t='+escape(document.title)+'&r='+s;
	                 
	//netscape="Netscape User's hit CTRL+D to add a bookmarkto this site.";
	
	
	if(window.external){window.external.addFavorite('http://'+document.domain,'GameSegment.com - Your Worldwide Gaming Source')};if(window.sidebar){window.sidebar.addPanel('GameSegment.com - Your Worldwide Gaming Source','http://'+document.domain,'')}
	

}

function bookmark_pricetool()
{

	i = new Image();
	s = Math.round(1E10*Math.random());
	//store bookmark
	i.src='http://www.gamesegment.com/link/bookmark.cfm?t='+escape(document.title)+'&r='+s;
	                 
	//netscape="Netscape User's hit CTRL+D to add a bookmarkto this site.";
	
	
	if(window.external){window.external.addFavorite(document.URL,'Price Comparison Tool - Video Games - GameSegment.com')};if(window.sidebar){window.sidebar.addPanel('Price Comparison Tool - Video Games - GameSegment.com',document.URL,'')}
	

}

function bookmark_bestPrices()
{

	i = new Image();
	s = Math.round(1E10*Math.random());
	//store bookmark
	i.src='http://www.gamesegment.com/link/bookmark.cfm?t='+escape(document.title)+'&r='+s;
	                 
	//netscape="Netscape User's hit CTRL+D to add a bookmarkto this site.";
	
	
	if(window.external){window.external.addFavorite(document.URL,'Best Prices - Video Games - GameSegment.com')};if(window.sidebar){window.sidebar.addPanel('Best Prices - Video Games - GameSegment.com',document.URL,'')}
	

}

function bookmarkcurrent()
{

	i = new Image();
	s = Math.round(1E10*Math.random());
	//store bookmark
	i.src='http://www.gamesegment.com/link/bookmark.cfm?t='+escape(document.title)+'&r='+s;
	
	if(window.external){window.external.addFavorite(document.location,document.title)};if(window.sidebar){window.sidebar.addPanel(document.title,document.location,'')}
	

}


function openwin(theURL, winname, popupwidth, popupheight, options) {
	var agt=navigator.userAgent.toLowerCase();
  	var is_ie=(agt.indexOf("msie") != -1);
 	//if window already opened close it, then open new one 
  	if ((window.winHandle) && (!window.winHandle.closed) && (is_ie))   {
  		window.winHandle.close();
  	}

	//open new window
    var popup_width=popupwidth
    var popup_height=popupheight
    var screen_width=window.screen.width
    var screen_height=window.screen.height
    var popup_left=Math.round((screen_width-popup_width)/2)
    var popup_top=Math.round((screen_height-popup_height)/2)     
    var winHandle=window.open(theURL,winname,"height="+popup_height+",width="+popup_width+",left="+popup_left+",top="+popup_top+","+options);
	
	//do this to make sure its not open in background
	winHandle.focus();
	
}

