/*
 * Usage:
 *	href="Javascript:launchRemote('request-help.html','helpme',495,500);"
 */

 //<!------ OAS SETUP begin ------>
// <SCRIPT LANGUAGE=JavaScript>
//<!--
//configuration
OAS_url ='http://multi1.rmuk.co.uk/RealMedia/ads/';
OAS_listpos = 'Top,BottomRight';
OAS_query = '?';
OAS_sitepage = 'www.busted.com/general';
//end of configuration
OAS_version = 10;
OAS_rn = '001234567890'; OAS_rns = '1234567890';
OAS_rn = new String (Math.random()); OAS_rns = OAS_rn.substring (2, 11);
function OAS_NORMAL(pos) { 
document.write('<A HREF="' + OAS_url + 'click_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" TARGET=_top>');
document.write('<IMG SRC="' + OAS_url + 'adstream_nx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + '!' + pos + OAS_query + '" BORDER=0 ALT="Click!"></A>');
}
//-->
//</SCRIPT>
//<SCRIPT LANGUAGE=JavaScript1.1>
//<!--
OAS_version = 11;
if (navigator.userAgent.indexOf('Mozilla/3') != -1)
OAS_version = 10;
if (OAS_version >= 11)
document.write('<' + 'SCRIPT LANGUAGE=JavaScript1.1 SRC="' + OAS_url + 'adstream_mjx.ads/' + OAS_sitepage + '/1' + OAS_rns + '@' + OAS_listpos + OAS_query + '"><\/SCRIPT>');
//-->
//</SCRIPT><SCRIPT LANGUAGE='JavaScript'>
 //<!-- 
 document.write('');
function OAS_AD(pos) {
if (OAS_version >= 11)
  OAS_RICH(pos);
else
  OAS_NORMAL(pos);
}
//-->
//</SCRIPT>
//<!------ OAS SETUP end ------>

 function openWin(wName, wWidth, wHeight, wResize)
{
	  features = 'scrollbars=1,status=1,resizable=' + ((wResize) ? 1 : 0) + ((wWidth) ? ',width=' + wWidth : '') + ((wHeight) ? ',height=' + wHeight : '');
	popWin = window.open('', wName, features);
	
	if(popWin.focus) { popWin.focus(); }
        return true;
}

function launchWindow(frameURL, winName,wt,ht)  {
                                scrWidth = screen.width;
                                scrHeight = screen.height;
                                posx = (scrWidth-wt)/2;
                                posy = (scrHeight-ht)/2;

		features = 'toolbar=no,location=no,directories=no,status=no,resizable=no,scrollbars=no,width='+wt+',height='+ht+',Top='+posy+',left='+posx;
		window.open (frameURL, winName, features);
}

function launchWindowScroll(frameURL, winName,wt,ht)  {
                                scrWidth = screen.width;
                                scrHeight = screen.height;
                                posx = (scrWidth-wt)/2;
                                posy = (scrHeight-ht)/2;

		features = 'toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,width='+wt+',height='+ht+',Top='+posy+',left='+posx;
		dlg = window.open (frameURL, winName, features);
}

function launchWindowScrollStatus(frameURL, winName,wt,ht)  {
                                scrWidth = screen.width;
                                scrHeight = screen.height;
                                posx = (scrWidth-wt)/2;
                                posy = (scrHeight-ht)/2;

		features = 'toolbar=no,location=no,directories=no,status=yes,resizable=yes,scrollbars=yes,width='+wt+',height='+ht+',Top='+posy+',left='+posx;
		dlg = window.open (frameURL, winName, features);
}

function launchRemote(frameURL, winName, pxwidth, pxheight, pxtop, pxleft, options)  {
	
	var toolbar = "no";
	var location = "no";
	var directories = "no";
	var status = "no";
	var menubar = "no";
	var scrollbars = "0";
	var resizable = "no";

	if (pxheight==null)	pxheight= 550;
	if (pxwidth==null)	pxwidth	= 790;
	
	if (pxleft==null)	pxleft	= Math.floor((screen.width - pxwidth) / 2);
	if (pxtop==null)	pxtop	= Math.floor((screen.height - pxheight) /2);

	if (screen.width==800) {
		pxleft=0;
		pxtop=0;
	}

	//this will parse the options parameter (not finished yet)
	if (options) {
		if (options.indexOf('status')!=-1) {
			status = "yes";
		}
		if (options.indexOf('menubar')!=-1) {
			menubar = "yes";
		}
		if (options.indexOf('scrollbar')!=-1) {
			scrollbars = "1";
		}
		if (options.indexOf('scrollbars')!=-1) {
			scrollbars = "2";
		}
	}

	features =  "toolbar=" + toolbar + ",";
	features += "location=" + location + ",";
	features += "directories=" + directories + ",";
	features += "status=" + status + ","; 
	features += "menubar=" + menubar + ",";
	features += "scrollbars=" + scrollbars + ",";
	features += "resizable=" + resizable + ",";
	features += "top=" + pxtop + ",";
	features += "left=" + pxleft + ",";
	features += "width=" + pxwidth + ",";
	features += "height=" + pxheight;
	
	//debug:
	//alert("Parameter values for LaunchRemote function:-\n\nURL: " + frameURL + "\n" + "Name: " + winName + "\n\n" + "Features: " + features);
	
	winName = 'graphico_little_' + winName;
	
	return window.open (frameURL, winName, features)

}

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1) end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}