
//********************************************************************************

function popwin(theurl,thename,thewidth,theheight,special,left,top,scroll,resize) {
				if (special==1) {
						var left=(screen.width-thewidth)/2;
						var top=(screen.height-theheight)/2;
					}
				var popwin = window.open(theurl,thename,"left="+left+",top="+top+",width="+thewidth+",height="+theheight+",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+scroll+",resizable="+resize+"");
			} 
//********************************************************************************


function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}


//********************************************************************************


function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


//********************************************************************************


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 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_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 window_shut(msg) {
	if(confirm(msg)) {
		top.window.self.close();
	}
}

//********************************************************************************

function open_full(url,id) {
	window.open(url,id,'type=fullWindow,fullscreen,scrollbars=yes');
}

//********************************************************************************
function section_fetch(sec) {
	//obj=MM_findObj('content_frame',window);
	parent.frames[1].location.href=sec+'.php';
}
//********************************************************************************

function nav_check() {
	//vars
	var url=document.location.href;
	var slash=url.lastIndexOf("/");
	var php=url.lastIndexOf(".php");
	var page=url.substr(slash+1,php-slash-1);
	//first check we have a nav
	if(!parent.frames[0]) {
		//no!, so redirect
		window.document.location.href=url.substr(0,slash+1)+"?sec="+page;
	} else if(parent.frames[0].is_loaded==1){
		//send a message to the nav to make sure it is in the right place - in case this page was directly linked from another etc.
		var _tar=MM_findObj('polly_nav',parent.frames[0].document);
		//send the data and call the frame
		if(_tar) {
    		_tar.SetVariable("/:jscript_send", page);
			_tar.TCallLabel ("/","menu_check");
		}
	}
}

//********************************************************************************
function img_set(_id) {
	if(parent.document.location.href.indexOf("index_low.php")==-1) {
		var list=Array("left","right","top","bottom");
		for(i=0;i<list.length;i++) {
			var _tar=MM_findObj('strip_'+list[i],parent.document);
			_tar.src='gfx/strips/'+_id+'_'+list[i]+'.jpg';
		}
	}
}

//********************************************************************************

function set_loaded() {
	is_loaded=1;
}

//********************************************************************************

var res_limits=Array(1024,768);
function res_check() {
	//test
	if (self.screen) {     // for NN4 and IE4
	        width = screen.width
	        height = screen.height
	} else if (self.java) {   // for NN3 with enabled Java
	       var jkit = java.awt.Toolkit.getDefaultToolkit();
	       var scrsize = jkit.getScreenSize();       
	       width = scrsize.width; 
	       height = scrsize.height; 
	} else {
		width = height = '?' // N2, E3, N3 w/Java off, probably Opera and WebTV
	}
	//return
	if(width=="?" || height=="?" || width<res_limits[0] || height<res_limits[1]) {
		return false;
	} else {
		return true;
	}
}

//********************************************************************************

function media_kill(_skip) {
	for(i=1;i<=media_count;i++) {
		if(i!=_skip) {
			//kill this item
			var _tar=MM_findObj('player'+i);
			_tar.TCallLabel ("/","stop_me");
		}
	}
}