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_reloadPage(init) {  // reloads the window if Nav4 resized //
  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);

function TJKOpen(zHref){  // v0.1 by TJKDesign.com //
	var TJKwin;
	TJKwin=window.open(zHref,'TJKwin');
	TJKwin.focus();
	return false;
}

function TJKpopup(zaref,w,h){  // v0.1 by TJKDesign.com //
	var TJKwin;
	var settings = "width="+w+",height="+h+",scrollbars=yes,toolbar=yes,location=yes,menubar=yes,status=yes,resizable=yes";
	TJKwin=window.open(zaref.href,'TJKwin',settings);
	TJKwin.focus();
}

// This script is from projectseven.com //
// Originaly it is to be used with *UL* //
function P7_swapClass(){ // v1.4 by PVII //
 var navlinks=document.getElementById('nav').value; // to count the no of subnavigation links by adnan
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 if(document.getElementsByTagName){for(i=4;i<arg.length;i++){tB=document.getElementsByTagName(arg[i]);
  for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
	 
	 for(w=1;w<=navlinks;w++)
	  	{
			if(document.getElementById('m'+w).className=="closed")
			  {	
			  	document.getElementById('pimg'+w).src='images/arrowlink.jpg';
				document.getElementById('m'+w).style.background ='url("")';
			  }
			else
			  {	
				document.getElementById('m'+w).style.background ='url("images/bgselimage.jpg")';
				document.getElementById('pimg'+w).src='images/arrowlinkdown.jpg';
			  }
		}
  if(tA[i].className){if(tA[i].id==arg[1]){if(arg[0]==1){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}else{tA[i].className=arg[2];}
  }else if(arg[0]==1 && arg[1]=='none'){
	  if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){}}}}
}
function P7_writeStyles(op,a){ // v1.5 by PVII  //
if(op==0||document.getElementById){var tS="<sty"+"le type=\"text/css\">";
// I changed the line below, original script at: www.projectseven.com //
tS+=a+"<"+"/sty"+"le>";document.write(tS);document.close();}
}
P7_writeStyles(1,'.closed div{display:none;}.open div{display:block;}');

// Feeding a POLL id or going Random //
// Hiding the poll tables from DOM-challenged UAs //
function TJKpoll(zPOLL){ // v0.1 by TJKDesign.com //
POLLids = ["4","20","21","26","19","24"];
var POLLid = POLLids [Math.floor(Math.random()*POLLids.length)];
if (zPOLL == null) zPOLL=POLLid;
   if(document.getElementById){  
      var S="<scr"+"ipt"; 
      S=S+" src='/pm/xlaabsolute.asp?p="+zPOLL;
      S=S+"' type='text/javascript'>";
      S=S+"</scr"+"ipt>";
      document.write(S);
   }
}
   
// TJKDesign | writing to non-DOM compliant UAs //
function TJKalert(mess){
if (!document.getElementById) {
document.write(mess)
}   
}   
function readCookie(name)
{ // www.quirksmode.org/js/cookies.html#script //
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function TJKpeekaboo() { // v0.1 by TJKDesign.com //
var zBackOut = "url(/img/backwrap.jpg) repeat-y #ececec";
var zBackIn = "none #ececec";
var zStyle = readCookie("StyleName");
if (zStyle == "c") {zBackOut = "url(/img/backwrap.jpg) repeat-y";zBackIn = "none";}
if (document.getElementById){
zBar = document.getElementById("leftbar");
zOnglet = document.getElementById("onglet");	
zWrapper = document.getElementById("wrapper");	
zContent =  document.getElementById("content");	
	if (zOnglet.style.left == "0px"){
		zBar.style.display="block";
		zOnglet.style.left="171px";
		zWrapper.style.background=zBackOut;
		zContent.style.margin="0 15px 0 190px";
		}else{
		zBar.style.display="none";
		zOnglet.style.left="0px";
		zWrapper.style.background=zBackIn;
		zContent.style.margin="0 0 0 30px";
		}
	return false;	
	}
return true;	
}

// The swaping of SRC values on the logo triggers a wierd bug in MSIE5.2 Mac //
// This is to make sure there is *no* swap in MSIE5.2 Mac unless the page is //
// Msie5Mac.asp. The one where we demonstrate the Bug //
function TJKswap(arg) { // v0.1 by TJKDesign.com //
zpage=MM_findObj("ieMacBug"); // This is the MSIE5MAC.ASP page //
isMac52=false;
if (!zpage && (navigator.appVersion.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("5.2") != -1)) isMac52=true;
if (isMac52) return;
zobj=MM_findObj("homegif");
if (arg=="show"){zobj.src="/img/homepic.gif";} else if (arg=="hide") {
	zobj.src="/img/clear.gif";}
}

function TJK_BreakOut(){ // v0.1 by TJKDesign.com //
 if (self != top) top.location.replace(self.location);
}
TJK_BreakOut();
function viewCart(){
	if (window.paypal && !paypal.closed){
		paypal.focus()
		}else{
		alert('Your shopping cart is empty or has been closed.')
		}
	return false;
}

// From Simon Willison's Weblog
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {var oldonload = window.onload;if(typeof window.onload != 'function'){window.onload = func;}else{window.onload = function(){oldonload();func();}}}

