function MM_preloadImages() {
  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_swapImgRestore() {
  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_findObj(n, d) {
  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_swapImage() {
  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];}
}

if (navigator.appName == 'Netscape') {
  var browser = 'NS';
  var version = (navigator.appVersion);
}

if (navigator.appName == 'Microsoft Internet Explorer') {
  var browser = 'IE';
  var version = (navigator.appVersion);
}

NS4 = (document.layers) ? 1 : 0;

NS6 = ((browser == 'NS') && (document.getElementById)) ? 1 : 0;

var agent = navigator.userAgent.toLowerCase();

opera = (agent.indexOf("opera")!=-1) ? true : false

macs = (agent.indexOf("mac")!=-1) ? true : false

function MM_showHideLayers() {
  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 showHideLayersNS(layerName,actions){
	//alert(layerName);
	//alert(actions);
	if(NS4){
		document.layers[layerName].visibility = actions;
	}
	else {
		document.getElementById(layerName).style.visibility = actions;
		}
	}	
	
function popupWindow(url,name,width,height) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		if(newwindow){newwindow.window.focus();}
		else{window.alert('You may have popup blocking software running on your browser that is preventing you from viewing content or using functionality of the site.\nTo avoid this from happening temporarily disable your popup blocking software.');}
	}
	
function popupWindow2(url,name,width,height) {
		newwindow2 = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow2.window.focus();
	}

function popupWindow3(url,name,width,height) {
		newwindow3 = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow3.window.focus();
	}	
	
function popupWindowNoScroll(url,name,width,height) {
		newwindow4 = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0,left=162,top=200");
		newwindow4.focus();
	}	
	
function popupWindowScroll(url,name,width,height) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow.window.focus();
	}
function popupWindowNoScrollPos(url,name,width,height,left,top) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0,left="+left+",top="+top+"");
		newwindow.window.focus();
	}	
	
function popupWindowScrollPos(url,name,width,height,left,top,resize) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable="+resize+",location=0,scrollbars=1,copyhistory=0,left="+left+",top="+top+"");
		newwindow.window.focus();
	}
	
function popupWindowAdminWin(url) {
		newwindow = window.open(url,'MAINADMINWIN', "width=785,height=540,toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=10,top=10");
		newwindow.window.focus();
	}
	
function generalPopup(url,name,width,height,left,top,resize,tool,menu,directories,status,location,scrollbars,history){
		generalwindow = window.open(url,name, "width="+width+",height="+height+",toolbar="+tool+",directories="+directories+",menubar="+menu+",status="+status+",resizable="+resize+",location="+location+",scrollbars="+scrollbars+",copyhistory="+history+",left="+left+",top="+top+"");
		generalwindow.window.focus();
	}
	
function closeThisOpenThat(redirectUrl){		
		parent.opener.location = redirectUrl;
		self.close();		
	}
	
function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}	

function MM_jumpMenuInNew(selObj,restore){
  var url = 'http://'+selObj.options[selObj.selectedIndex].value;
  PCD = window.open(url,'');
  PCD.window.focus();
  if (restore) selObj.selectedIndex=0;  
}

function MM_reloadPage(init) {
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var cookiesaloud
function checkcookies() {
 if (document.cookie.length > 0) { 
  cookiesaloud = 1
 }
 else {  
  cookiesaloud = 0
 }
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function changeClass(cellid,strNewClass){	
	if((!macs)&&(!NS4)){
		document.getElementById(cellid).className=strNewClass;
		}
	}
	
function setNaviState(strpage){
		if(strpage!=""){
			if(!NS4){
				changeClass(strpage,"currentLink");
				}
			}
		}
		
function hideDDs(){
	if(browser=="NS"){		
		//showHideLayersNS("selectBrand","hidden");
		showHideLayersNS("sortByDiv","hidden");
	}
	if(browser!="NS"){
		//if(document.getElementById('selectBrand')){MM_showHideLayers("selectBrand","","hide");}		
		if(document.getElementById('sortByDiv')){document.getElementById('sortByDiv').style.visibility = "hidden";}
		}	
	}
	
function showDDs(){
	if(browser=="NS"){				
		//showHideLayersNS("selectBrand","visible");
		showHideLayersNS("sortByDiv","visible");
	}
	if(browser!="NS"){
		//if(document.getElementById('selectBrand')) MM_showHideLayers("selectBrand","","show");
		if(document.getElementById('sortByDiv')){document.getElementById('sortByDiv').style.visibility = "visible";}
		}	
	}
	
function setImageSize(maxImgHeight, maxImgWidth) {
    //"Constansts"
    var thumbPrefix = "thumb_"; //What's before thumbnail's IDs
    var maxWidth = maxImgWidth, maxHeight = maxImgHeight; //Max size of thumbnails
    //If we can access the images
    if (document.images) {
      //Loop for all images
      for (var loopCounter = 0; loopCounter < document.images.length; loopCounter++) {
        //If this one starts with thumbPrefix
        if (document.images[loopCounter].id.substring(0, thumbPrefix.length) == thumbPrefix) {
          //If this one is too wide, shrink it
          if (document.images[loopCounter].width > maxWidth)
            document.images[loopCounter].width = maxWidth;
          //Same for height
          if (document.images[loopCounter].height > maxHeight)
            document.images[loopCounter].height = maxHeight;
        }
      }
    }
  }
  
 function sendContactEMail(box){
		var strDom = "venturesport.co.uk"
		var strBox = box
		document.location.href = "mailto:"+strBox+"@"+strDom
		}

