// JavaScript Document
/*function P7_limit(a,b){ //v1.1.2 by PVII-www.projectseven.com
 document.p7limit=a;document.p7min=b;
 if(document.getElementById&&navigator.appVersion.indexOf("MSIE")>-1&&!window.opera){
 if(window.attachEvent){window.attachEvent("onresize",P7_setMinWidth);
 window.attachEvent("onload",P7_setMinWidth);}else{onload=P7_setMinWidth;
 onresize=P7_setMinWidth;}}}P7_limit('outer',766); //960

function P7_setMinWidth(){ //v1.1.2 by PVII-www.projectseven.com
 var cw,w,pl,pr,ml,mr,br,bl,ad,theDiv=document.p7limit;
 var g=document.getElementById(theDiv);w=parseInt(document.p7min);
 if(g&&document.body&&document.body.clientWidth){gs=g.currentStyle;
 cw=parseInt(document.body.clientWidth);pl=parseInt(gs.paddingLeft);
 pr=parseInt(gs.paddingRight);ml=parseInt(gs.marginLeft);mr=parseInt(gs.marginRight);
 bl=parseInt(gs.borderLeftWidth);br=parseInt(gs.borderRightWidth);ml=ml?ml:0;
 mr=mr?mr:0;pl=pl?pl:0;pr=pr?pr:0;bl=bl?bl:0;br=br?br:0;ad=pl+pr+ml+mr+bl+br;
 if(cw<=w){w-=ad;g.style.width=w+"px";}else{g.style.width="auto";}}
}*/

function P7_swapClass(){ //v1.4 by PVII
 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++){
  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]){tA[i].className=arg[3];}}}}
}

function P7_writeStyles(op,a){ //v1.5 by PVII
if(op==0||document.getElementById){var tS="<sty"+"le type=\"text/css\">";
tS+=a+"<"+"/sty"+"le>";document.write(tS);document.close();}
}
P7_writeStyles(1,'.closed ul{ display:none;}.open ul{ display:block;}');

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 addBookmark() {
	 if (window.external)
	   external.AddFavorite(location.href,"UP Website")
	 else
    alert("Please press Ctrl+D to bookmark UP Website");
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_popupMsg(msg) { //v1.0
  alert(msg);
}

function getData() {
// Read from & write to cookie
var pos = document.cookie.indexOf("*");
var udata = unescape(document.cookie);
var udata2 = udata.substring(pos+1,pos+7);
var udata3 = udata2;
return udata3;
} // End function getData

function rdwr(s){
// Read from & write to cookie
var Data = getData();
var m1 = Data.substring(0,1);
var m2 = Data.substring(2,3);
var mpos = Data.substring(4,6);

if(s=="I") if (m1 == "c") m1 = "o"; else m1 ="c";
else if (s=="G") if (m2 == "c") m2 = "o"; else m2 ="c";
var menu = "*" + m1 + " " + m2 + " " + mpos;

document.cookie = menu;

} // End function rdwr

function OpenClose(inType,PID) {
/* inType can be I(Indivudual) or G(Group) */
if (inType=="I") rdwr("I"); else rdwr("G");

var gElem = document.getElementById(PID);
if (gElem.className == "closed")gElem.className = "open"; 
else gElem.className = "closed";

} // End function OpenClose

function MenPos(itemNum) {
/*alert('You are now in MenPos!');*/
var data = getData();
var m1 = data.substring(0,1);
var m2 = data.substring(2,3);
var mpos = data.substring(4,6);

mpos = itemNum;
var menu = "*" + m1 + " " + m2 + " " + mpos;
var menu2 =m1+m2+mpos;
/*alert('The value  of the cookie in MemPos is ' + menu);*/
document.cookie = menu;
} // End function MenPos

function jstest(){
window.location = "index1.asp";
}
