var overdiv=0,mE=0,disZ=0,menu_1=0,dFLAG=0,sFLAG=0,pSUB=0,FST=1,m_label=0,m_adv=0,rF=0;var OZ=[];

function fi(I,X1,X2){var p;
	if(I==0.5){p="960.php?";}
	if(I==1){p="CMNT.php?AX=1&TEMP=4&UID=";}// Pho Cmnts
	if(I==1.1){p="CMNT.php?AX=1.1&TEMP=6&UID=";}// Label
	if(I==1.5){p="CMNT.php?AX=1.5&TEMP=1&UID=";}// Article
	if(I==1.6){p="CMNT.php?AX=1.6&TEMP=2&UID=";}// Hike
	if(I==1.7){p="CMNT.php?AX=1.7&TEMP=3&UID=";}// Route
	if(I==2){p="CMNT.php?AX=2&TEMP=5&UID=";}// Trip
	if(I==3){p="elementSTAT.php?";}
	if(I==4){p="elementTLOGS.php?";}
	if(I==5){p="elementFF.php?";}

	if(I==6){p="elementSTAT.php?ID=22";}//Pixelmast
	if(I==7){p="elementSTAT.php?ID=21&";}//My Pho
	if(I==8){p="elementSTAT.php?ID=18";}//My Top Rated Pho
	if(I==9){p="elementSTAT.php?ID=19";}//My Top Viewed Pho
	if(I==9.7){p="elementSTAT.php?ID=19.7";}//AddDayLate
	if(I==9.8){p="elementSTAT.php?ID=19.8&Z_SORT="+X1+"&SUB_ID="+X2+"&ZF=";}//Author Ays
	if(I==9.9){p="elementSTAT.php?ID=19.9&Z_SORT="+X1+"&SUB_ID="+X2+"&ZF=";}//Annual TL Ays

	if(I==10){p="elementSTAT.php?ID=1&UID=";}//Hikes
	if(I==10.1){p="elementSTAT.php?ID=1.1&UID=";}//Hike Ovrvews
	if(I==11){p="elementSTAT.php?ID=2&UID=";}//Photosets
	if(I==11.1){p="elementSTAT.php?ID=2.1&UID=";}//Phosets inQue
	if(I==11.2){p="elementSTAT.php?ID=2.2&UID=";}//Geocoded Phosets
	if(I==12){p="elementSTAT.php?ID=4&UID=";}//H Rated
	if(I==13){p="elementSTAT.php?ID=14&UID=";}//GPS
	if(I==14){p="elementSTAT.php?ID=20";}//Cal
	if(I==14.1){p="elementSTAT.php?ID=20.1";}//Cal by Pho
	if(I==15){p="elementSTAT.php?ID=44";}//Pho Rated
	if(I==15.1){p="elementSTAT.php?ID=44&UID=";}//Pho Rated
	if(I==15.5){p="elementSTAT.php?ID=44.5";}//Pho Tags
	if(I==15.6){p="elementSTAT.php?ID=44.5&UID=";}//Pho Tags
	if(I==16){p="elementTLOGS.php?UID=0";}//Triplogs
	if(I==17){p="elementFF.php?dex=2&";}//Fauna
	if(I==18){p="elementFF.php?dex=1&";}//Flora
	if(I==18.3){p="elementFF.php?dex=3&";}//Geology
	if(I==18.4){p="elementFF.php?dex=4&";}//Culture
	if(I==18.5){p="elementFF.php?dex=5&";}//Gear
	if(I==18.6){p="elementFF.php?dex=6&";}//All
	if(I==19){p="elementSTAT.php?ID=25&";}//My Fauna Pho
	if(I==20){p="elementSTAT.php?ID=26&";}//My Flora Pho
	if(I==20.3){p="elementSTAT.php?ID=26.3&";}//My Geology Pho
	if(I==20.4){p="elementSTAT.php?ID=26.4&";}//My Culture Pho
	if(I==21){p="elementSTAT.php?ID=27&";}//Wildflower TLs
	if(I==22){p="elementSTAT.php?ID=28&";}//Autumn TLs
	if(I==23){p="elementSTAT.php?ID=29&";}//Pro Pho Updates
	if(I==24){p="elementSTAT.php?ID=31&";}//Spring Flow (single)
	if(I==24.1){p="elementSTAT.php?ID=30&";}//Spring Flow Report
	if(I==25){p="elementDEX.php?";}
	if(I==26){p="elementSTAT.php?ID=100&";}//Memberlist
	if(I==27){p="elementSTAT.php?ID=5";}//Memberlist
	if(I==28){p="elementSTAT.php?ID=32&";}// Forum Active Posts
	if(I==29){p="elementSTAT.php?ID=33&";}// Unused
	if(I==30){p="elementSTAT.php?ID=34&";}// Label Catgry-for PhoID ie:Yellow
	if(I==31){p="elementSTAT.php?ID=35&UID=";}// Art Summary
	if(I==32){p="elementSTAT.php?ID=14.5&UID=";}// Linked G
	if(I==33){p="elementSTAT.php?ID=17&UID=";}// Top Photos
	if(I==35){p="elementSTAT.php?ID=6&UID=";}// Most Printed H
	if(I==36){p="elementSTAT.php?ID=7&UID=";}// Most Viewed H
	return p;}

function aL(){$('#ALPHAdiv').fadeOut(100).html('<table style="position:relative;z-index:+5000;width:120px;height:24px;background:url(../images/corners/5B-24.png);"><tr><td style="text-align:center;font-family:arial;font-size:14px;">Loading</td></tr></table>').fadeIn(400);}
function aR(){$('#ALPHAdiv').fadeOut(100).html('Hike Arizona it <span style="color:#8B0000;"><i>Rocks!</i></span>').show(400);}

function ax(I,J,TAG,xTYPE,X1,X2,U,S){
	document.getElementById('pI').value=I;
	document.getElementById('pJ').value=J;
	document.getElementById('pU').value=U;
	document.getElementById('pS').value=S;
	pSUB=0;
	var page = fi(I,X1,X2);
	var rdt;if(I>0.5){rdt='&RDT=';}else{rdt='RDT=';}	

	if(xTYPE!=3){$('#PL_I').html('<center><img name="LGIF" id="LGIF" src="../images/hazjax-loader.gif"></center>');}
	
	if(xTYPE==2&&TAG<1){
		$('#dexDIV').load('../'+page+J+'&NHS=1',function(){$('#divFULL').load('header-SAVE.php?RDT='+new Date().getTime());});}// Rst btns
	else if(xTYPE==3){aL();$('#dexDIV').load('../'+page+J+rdt+new Date().getTime(),function(){if(TAG>0){findPos(document.getElementById('FLOAT_'+TAG));}$('#divFULL').load('header-SAVE.php?RDT='+new Date().getTime());});}// w/Cancel
	else{aL();$('#dexDIV').load('../'+page+J+rdt+new Date().getTime(),function(){if(TAG>0){findPos(document.getElementById('FLOAT_'+TAG));}$('#result').load('header-SAVE.php?RDT='+new Date().getTime());});}//page loads
	
	}

function R_ALL(){$("#HF_I").html('<img src="../images/hazjax-loader.gif">');}

function xscroll(ANC){if(ANC>0){location.hash=ANC;}}

function OCA(DIV){if(document.getElementById(DIV).style.display=="none"){document.getElementById(DIV).style.display="block";}else{document.getElementById(DIV).style.display="none";}}

function OCD(DIV){if(document.getElementById(DIV).innerHTML==""){return 1;}else{document.getElementById(DIV).innerHTML=""; return 0;}}

var menu_sort = 'hidden';
var member_sort = 'hidden';
function switch_sort(){
	switch (menu_sort){
		case 'shown':
			member_sort = 'hidden';menu_sort = 'hidden';
			$('#HIKEdiv').load('../dex2/TLOGS_SELECT.php?SHOW=1&PRIDY=<?="$PRIDY";?>&TID=G1'+'&RDT='+new Date().getTime());
		break;
		case 'hidden':
			member_sort = 'hidden';menu_sort = 'shown';
			$('#HIKEdiv').load('../dex2/TLOGS_SELECT.php?SHOW=2&PRIDY=<?="$PRIDY";?>&TID=G1'+'&RDT='+new Date().getTime());
		break;}}

function switch_member(){
	switch (member_sort){
		case 'shown':
			member_sort = 'hidden';menu_sort = 'hidden';
			$('#HIKEdiv').load('../dex2/MEMBER_SELECT.php?SHOW=1&PRIDY=<?="$PRIDY";?>&TID=G2'+'&RDT='+new Date().getTime());
		break;
		case 'hidden':
			member_sort = 'shown';menu_sort = 'hidden';
			$('#HIKEdiv').load('../dex2/MEMBER_SELECT.php?SHOW=2&PRIDY=<?="$PRIDY";?>&TID=G2'+'&RDT='+new Date().getTime());
		break;}}

function element_load(){
	var browser=navigator.appName;
	if(browser=="Microsoft Internet Explorer"){
	document.getElementById('PL_I').innerHTML='<center><font style="font-family:arial;">Loading</font></center>';}
	else{
	document.getElementById('PL_I').innerHTML='<center><img name="LGIF" id="LGIF" src="../images/hazjax-loader.gif"></center>';}}

function page_load(){
	var browser=navigator.appName;
	if(browser=="Microsoft Internet Explorer"){
	document.getElementById('PL').innerHTML='<center><font style="font-family:arial;color:#FFF;">Loading</font></center>';}
	else{
	document.getElementById('PL').innerHTML='<center><img name="LGIF" id="LGIF" src="../images/hazjax-loader.gif"></center>';}}

function findPosX(X){var pos=$(X).offset();return pos.left;}

function findPosY(X){var pos=$(X).offset();return pos.top;}
 
function popEDIT(ZIP,PID,START){
	$('#object1').load('xPHO_EDIT.php?ZIP='+ZIP+'&PID='+PID+'&start='+START+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=x+"px";
	document.getElementById("object1").style.top=y-100+"px";}

function popBOOK(ID){menu_1=1;
	$('#object1').load('xBOOK.php?ID='+ID+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=x+50;
	document.getElementById("object1").style.top=y-100;
	}

function FFLOAD(){
	document.getElementById("divTHREE").innerHTML="<BR><BR><BR><center><font style='color:#F00;font-size:24px;'>Loading...</font></center>";}

function FFLOAD2(){
	document.getElementById("divZERO").innerHTML="<BR><BR><BR><center><font style='color:#F00;font-size:24px;'>Loading...</font></center>";}

function FFLOAD3(){
	document.getElementById("listDIV").innerHTML="<BR><BR><BR><BR><BR><center><font style='color:#F00;font-size:24px;'>Loading...</font></center>";}

function popFF(DEX,PID){
	$('#object1').load('xFAMILY.php?dex='+DEX+'&PID='+PID+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=+210+"px";
	document.getElementById("object1").style.top=y-50+"px";}

function popGPS(GPS,TAID,X,Y,CL,OFF){
	if(X>0 || X<0 || Y>0 || Y<0){hideLayer();showPage('../gpsRDIV.php?TAID='+TAID+'&INCF=2&OFF='+OFF+'&GPS='+GPS+'&RDT='+new Date().getTime(),'object1',0,CL);
	document.getElementById("object1").style.left=X+"px";document.getElementById("object1").style.top=Y+"px";}
	else{showPage('../decoder-AUTHOR.php?TAID='+TAID+'&INCF=2&OFF='+OFF+'&GPS='+GPS+'&RDT='+new Date().getTime(),'rFEATUREset',0,CL);}}

function popLayer(PRIDY){
	$('#object1').load('xSTAT.php?PRIDY='+PRIDY+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=($('body').innerWidth()/2)-225+"px";
	document.getElementById("object1").style.top=y+"px";}

function popPHOTO(ZIP,PRI){
	$('#object1').load('xPHOTO.php?ZIP='+ZIP+'&PRIDY='+PRI+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=x-200+"px";
	document.getElementById("object1").style.top=y-80+"px";}

function popPHOTO2(ID,OBJCT,X,Y){
	$('#objectM').load('xPHOTO.php?ZIP='+ID+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("objectM").style.left=findPosX(OBJCT)+X+"px";
	document.getElementById("objectM").style.top=findPosY(OBJCT)+Y+"px";}

function memPHOTO(ZIP,PRI){
	$('#object1').load('xMPHOTO.php?ZIP='+ZIP+'&PRIDY='+PRI+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=x-140+"px";
	document.getElementById("object1").style.top=y-120+"px";}

function popMEMBER(u,OBJCT,X,Y){
	$('#object1').load('xMEMBER.php?u='+u+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	if(OBJCT){
	document.getElementById("object1").style.left=findPosX(OBJCT)+X+"px";
	document.getElementById("object1").style.top=findPosY(OBJCT)+Y+"px";}
	else{
	document.getElementById("object1").style.left=x+50+"px";
	document.getElementById("object1").style.top=y-100+"px";}}

function popSPRING(ID,X){
	$('#object1').load('xSPRING.php?ID='+ID+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	if(X==1){document.getElementById("object1").style.left=200;document.getElementById("object1").style.top=y-250+"px";}
	else{document.getElementById("object1").style.left=300;document.getElementById("object1").style.top=y+"px";}}

function hideF(){document.getElementById("objectF").innerHTML="";}

function hideLayerM(){pSUB=0;if($('#objectM').length){document.getElementById("objectM").innerHTML="";}}

function hideLayer2(){document.getElementById('object2').style.display='none';document.getElementById("object2").innerHTML="";}

function hideLayer3(){document.getElementById('object3').style.display='none';document.getElementById("object3").innerHTML="";}

function hideLayer4(){document.getElementById('object3').style.display='none';document.getElementById("object3").innerHTML="";}

function hideLayer(){
	pSUB=0;menu_1=0;disZ=0;sFLAG=0;dFLAG=0;rF=0;
	$("#object1").empty();
	hideLayerM();}

function popSUB(ID,OB,X,Y,UR,M,MX,MY){
	if($.browser.msie){if(M!=1){X=X-(($('body').innerWidth()-960)/2)-($.scrollbarWidth()/2);}}
	if($.browser.msie){if(MX){X=X+MX;}if(MY){Y=Y+MY;}}
	if(pSUB===0){
	$('#objectM').load('../xSUBMENU.php?ID='+ID+UR+'&RDT='+ new Date().getTime()).hide().fadeIn(400);
	document.getElementById("objectM").style.left=findPosX(OB)+X+"px";
	document.getElementById("objectM").style.top=findPosY(OB)+Y+"px";
	pSUB=1;}
	else{hideLayer();}}

function popS(ID,OB,X,Y,O,UR){if(O>$('body').innerWidth()){X=0;}else{X=X+(($('body').innerWidth()-O)/2)-($.scrollbarWidth()/2);}
	if(pSUB===0){
	$('#objectM').load('../xSUBMENU.php?ID='+ID+UR+'&RDT='+ new Date().getTime()).hide().fadeIn(400);
	document.getElementById("objectM").style.left=X+"px";
	document.getElementById("objectM").style.top=findPosY(OB)+Y+"px";
	pSUB=1;}
	else{hideLayer();}}

function popMENU(ID, SUB_ID, u, DEX){
	$('#object1').load('xMENU.php?ID='+ID+'&SUB_ID='+SUB_ID+'&u='+u+'&dex='+DEX+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	document.getElementById("object1").style.left=x-50+"px";
	document.getElementById("object1").style.top=y-20+"px";}

function helpME(ID,X,Y,UID,ZIP,CP,DATA,DiV){if(DiV==1){DiV="objectM";}else{DiV="object1";}
	if(!$('#'+DiV).length){dD(DiV,'','','absolute','0','0','','','3');}
	menu_1=1;
	$("#"+DiV).load("../xHELP.php?ID="+ID+"&UID="+UID+"&ZIP="+ZIP+"&DATA="+DATA+"&DiV="+DiV+'&RDT='+new Date().getTime()).hide().fadeIn(400);
	if(CP==1){
	document.getElementById(DiV).style.left=($('body').innerWidth()/2)+X+"px";
	document.getElementById(DiV).style.top=y+Y+"px";}
	else if(CP==2){
	document.getElementById(DiV).style.left=($('body').innerWidth()/2)+X+"px";
	document.getElementById(DiV).style.top=($(window).height()/2)+Y+"px";}
	else if(CP==3){
	document.getElementById(DiV).style.left=($('body').innerWidth()/2)+X+"px";
	document.getElementById(DiV).style.top=Y+"px";}
	else{
	if(X>0 || X<0){document.getElementById(DiV).style.left=x+X+"px";document.getElementById(DiV).style.top=y+Y+"px";}
	else if(Y>0 || Y<0){document.getElementById(DiV).style.left="150px";document.getElementById(DiV).style.top=y+Y+"px";}
	else{document.getElementById(DiV).style.left="150px";document.getElementById(DiV).style.top="200px";}}}

function s_label(){
	if(m_label===0){$("#divFULL").hide().load('../FFc.php?FF=2&ASSOCt=1&ZIP=&alpha=A&RDT='+new Date().getTime(),function(){$(this).slideDown(500);});
	m_label=1;document.getElementById('l_hash').innerHTML='<img src="../images/icon/hash_down.gif">';}
	else{$("#divFULL").slideUp(500);m_label=0;
	document.getElementById('l_hash').innerHTML='<img src="../images/icon/hash_right.gif">';}}

function s_adv(){
	if(m_adv===0){$('#advDIV').load('../partnerADVq.php?RDT='+new Date().getTime());m_adv=1;
	document.getElementById('a_hash').innerHTML='<img src="../images/icon/hash_down.gif">';}
	else{$('#advDIV').load('../partnerADVq.php?ID=99RDT='+new Date().getTime());m_adv=0;
	document.getElementById('a_hash').innerHTML='<img src="../images/icon/hash_right.gif">';}}

function myR(){hideLayer();
	if(rF==1){rF=0;}
	else{rF=1;
	$('#object1').load('../xRESPONSE.php?RDT='+new Date().getTime()).hide().fadeIn(800);
	document.getElementById('object1').style.left=($('body').innerWidth()/2)-210+'px';
	document.getElementById('object1').style.top=100+'px';}}

function FFLOAD3(){
	document.getElementById("listDIV").innerHTML="<BR><BR><BR><BR><BR><center><font style='color:#F00;font-size:24px;'>Loading...</font></center>";}

function FFLABEL(){document.getElementById("listDIV").innerHTML="<BR><BR><BR><BR><BR><center><font style='color:#F00;font-size:24px;'>Labeling Photo...</font></center>";}

function OVER0(ID){window.location = "phoZOOM.php?ZIP="+ID+"&OVER=0";}
function OVER1(ID){window.location = "phoZOOM.php?ZIP="+ID+"&OVER=1";}
function LOAD0(ID){window.location = "phoZOOM.php?ZIP="+ID+"&LOAD=0";}
function LOAD1(ID){window.location = "phoZOOM.php?ZIP="+ID+"&LOAD=1";}

function disLayer(){disZ=1;}
function scroll_FF(H){var HGHT=H+100;setTimeout("window.scrollTo(0,"+HGHT+")",600);}

function getCheckedValue(radioObj) {
	if(!radioObj){return "";}
	var radioLength = radioObj.length;
	if(radioLength === undefined){if(radioObj.checked){return radioObj.value;}}else{return "";}
	for(var i=0; i<radioLength; i++){if(radioObj[i].checked){return radioObj[i].value;}}
	return "";}

function gof(xf){document.getElementById(xf).submit();}

function isE(v){if(v%2===0){return true;}else{return false;}}//#a2ceb9

function cRover(b,ID){if(b.style.backgroundColor!='#A2CEB9'){b.style.backgroundColor='#c1c5ff';}}

function cRout(b,ID){if(isE(ID)){b.style.backgroundColor='#E2E2E2';}else{b.style.backgroundColor='#FFFFFF';}}

var lastHt="TR0";
function Ht(b){document.getElementById(lastHt).style.background="";lastHt="TR"+b;document.getElementById(lastHt).style.background="#9afa95";}

function pop_forecast(X){aL();
	$('#objectF').load('forecast.php?e='+X+'&RDT='+new Date().getTime(),function(){aR();}).hide().fadeIn(400);
	$('#objectF').css('left',($('body').innerWidth()/2)-340-($.scrollbarWidth()/2)+'px');
	$('#objectF').css('top',+'100px');}
function popCYN(ZTN){aL();
	menu_1=1;
	$('#object1').load('xCANYON.php?ZTN='+ZTN+'&RDT='+new Date().getTime(),function(){aR();}).hide().fadeIn(400);
	document.getElementById('object1').style.left=($('body').innerWidth()/2)-150+"px";
	document.getElementById('object1').style.top=($(window).height()/2)-150+"px";}
function popCLB(ZTN){aL();
	menu_1=1;
	$('#object1').load('xCLIMB.php?ZTN='+ZTN+'&RDT='+new Date().getTime(),function(){aR();}).hide().fadeIn(400);
	document.getElementById('object1').style.left=($('body').innerWidth()/2)-350+"px";
	document.getElementById('object1').style.top=($(window).height()/2)-150+"px";}

// For upload Status
var HttpRequestObject = false;
if(window.XMLHttpRequest) {HttpRequestObject = new XMLHttpRequest();}
else if(window.ActiveXObject) {HttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");}

function getProgress(uid){
   if(HttpRequestObject){
      HttpRequestObject.open('GET', 'getprogress.php?uid=' + uid, true);
      HttpRequestObject.onreadystatechange = function(){
         if(HttpRequestObject.readyState == 4 && HttpRequestObject.status == 200) {
            var progress = HttpRequestObject.responseText;
            document.getElementById('pb_inner').style.width = progress + '%';
            document.getElementById('pb_inner').innerHTML = progress + '%';
            if(progress < 100){setTimeout(function(){getProgress(uid);}, 100);}
            else{document.getElementById('pb_inner').innerHTML='One moment...';}}};
      HttpRequestObject.send(null);}}

function startProgress(uid) {
   document.getElementById('upload').style.display = 'none';
   document.getElementById('pb_outer').style.display = 'block';
   setTimeout('getProgress("' + uid + '")', 1000);}

function dEKey(e){var key;
     if(window.event){key=window.event.keyCode;}//IE
     else{key=e.which;}//FF      
     return (key!=13);}

function addEvent(elm, evType, fn, useCapture){
   if(elm.addEventListener){elm.addEventListener(evType, fn, useCapture);return true;}
   else if(elm.attachEvent){return elm.attachEvent('on' + evType, fn);}
   else{elm['on' + evType] = fn;}}

function dD(D,w,h,a,l,t,b,B,z,H,c,x,y){
	if(!$('#'+D).length){
	$('<div id='+D+'></div>').appendTo('body');
	if(w){if(w.match(/%/)){$('#'+D).width(w);}else if(w.match(/px/)){$('#'+D).css('width',w);}else{$('#'+D).css('width',w+'px');}}
	if(h){if(h.match(/%/)){$('#'+D).height(h);}else if(h.match(/px/)){$('#'+D).css('height',h);}else{$('#'+D).css('height',h+'px');}}
	$('#'+D).css('position',a);
	if(l){$('#'+D).css('left',l);}
	if(t){$('#'+D).css('top',t);}
	if(b){$('#'+D).css('background-color',b);}
	if(B){$('#'+D).css('border',B);}
	if(z){$('#'+D).css('z-index',z);}
	if(H){$('#'+D).html(H);}
	if(c){$('#'+D).addClass(c);}
	if(x){$('#'+D).css('overflow-x',x);}
	if(y){$('#'+D).css('overflow-y',y);}
	}}

function rD(D){if($(D).length){$(D).fadeOut(250,function(){$(D).remove();});}}

function ie6(n){var el=document.documentElement.getElementsByTagName('select');for(var i=0; i<el.length; i++){el[i].style.visibility=n;}} 

$(window).bind('load',function(){
	dD('SCH','','','absolute','','','','','+1000','','popup');
	$('body').click(function() {document.getElementById('SCH').innerHTML='';});
	$('#alphaST').click(function(event){event.stopPropagation();});
	$('#SCH').click(function(event){event.stopPropagation();});
	if($('#PD1A').length){$('#PD1A').load('../poll.php?RDT='+new Date().getTime());}});

(function($,b,a){$.scrollbarWidth=function(){var c,d;if(a===b){c=$('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body");d=c.children();a=d.innerWidth()-d.height(99).innerWidth();c.remove()}return a}})(jQuery);

function psb(n,nx){
	$('#'+n).css('left',($('body').innerWidth()/2)-300-($.scrollbarWidth()/2)+'px');
	$('#'+n).css('top',findPosY(nx)+18+'px');}

function shw(STi,Ax,F,FTN,SLx){if(navigator.userAgent.match(/iPhone/i)){$('#ALPHAdiv').load('../ALPHAdiv.php?FTN='+FTN+'&STi='+STi+'&ID=11&SUB_ID='+Ax+'&RDT='+new Date().getTime());}else{$('#SCH').load('../ALPHAdiv.php?FTN='+FTN+'&STi='+STi+'&ID=11&SUB_ID='+Ax+'&RDT='+new Date().getTime(),function(){psb('SCH',SLx);});}}

function gow(STi,Ax,F_LEV){if(document.pcX.pcPAGE.value == "elementDEX.php"){document.getElementById('loadDIV').innerHTML='<table align=center cellpadding=0 cellspacing=0 style="border:none;font-family:arial;font-size:14px;"><tr><td><div><b class=spFC0><b class=spFC01><b></b></b><b class=spFC02><b></b></b><b class=spFC03></b><b class=spFC04></b><b class=spFC05></b></b><div class=spFC0fg>&nbsp;Loading...&nbsp;'+Ax+'&nbsp;</div><b class=spFC0><b class=spFC05></b><b class=spFC04></b><b class=spFC03></b><b class=spFC02><b></b></b><b class=spFC01><b></b></b></b></div></td></tr></table>';
	showPage3(F_LEV+'elementDEX.php?ID=11&SUB_ID='+Ax+'&STi='+STi,'dexDIV');}
	else{location = F_LEV+"interestDEX.php?ID=11&SUB_ID="+Ax+'&STi='+STi;}}

function urlencode(str) {str = (str+'').toString();
    return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').
                                                                    replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');}

var Url={encode:function(string){return escape(this._utf8_encode(string));},decode:function(string){return this._utf8_decode(unescape(string));},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}
else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}
else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}
else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}
else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}}

function wSTi(X){
	var tcd = new Date("December 31, 2023").toGMTString();
	document.cookie= "STi="+X+"; expires="+tcd+";";}

function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;}}}

function bE(x,X,U,D,R,L){if(!U){U=1500;}if(!D){D=1500;}$(X).slideUp(U).slideDown(D);hazF(X,R,L);return false;}

function hazF(X,R,L){
	if(!L){L=0;}
	if(!R){R='result';}if($('#ALPHAdiv').length&&L<1){aL();}else if($('#fn-modaldialog').length&&L<1){ }//fnLOAD();
        $.ajax({
            type: $(X).attr('method'),
            url: $(X).attr('action'),
	    enctype: $(X).attr('enctype'),
            data: $(X).serialize(),
            success: function(responseText){$('#'+R).html(responseText);if($('#ALPHAdiv').length&&L<1){aR();}else if($('#fn-modaldialog').length&&L<1){  }}});}//fnCLEAR();

// Global variables
x = 0;
y = 0;
xMax = 0;
yMax = 0;
scrOfY=0;
scrOfx=0;

function captureMousePosition(e) {
    if (document.layers) {// Netscape (old?)
        x=e.pageX;y=e.pageY;
        xMax = window.innerWidth+window.pageXOffset;	xWin=window.innerWidth;		scrOfY = window.pageYOffset;	bW=window.innerWidth;
        yMax = window.innerHeight+window.pageYOffset;	yWin=window.innerHeight;	scrOfX = window.pageXOffset;	bH=window.innerHeight;
    } else if (document.all) {// Windows
        x=window.event.x+document.body.scrollLeft;y=window.event.y+document.body.scrollTop;
xMax=document.body.clientWidth+document.body.scrollLeft;xWin=document.body.clientWidth;scrOfY=document.body.scrollTop;bW=document.body.offsetWidth;
yMax=document.body.clientHeight+document.body.scrollTop;yWin=document.body.clientHeight;scrOfX=document.body.scrollLeft;bH=document.body.offsetHeight;
    } else if (document.getElementById) {// Netscape 6 behaves as 4 in this regard
        x=e.pageX;y=e.pageY;
        xMax = window.innerWidth+window.pageXOffset;	xWin=window.innerWidth;		scrOfY = window.pageYOffset;	bW=window.innerWidth;
        yMax = window.innerHeight+window.pageYOffset;	yWin=window.innerHeight;	scrOfX = window.pageXOffset;	bH=window.innerHeight;
    }}

$(window).bind('load',function(){// TRACK MOUSE POSITION
	if (document.layers) { // NS
	    document.captureEvents(Event.MOUSEMOVE);document.onmousemove = captureMousePosition;
	} else if (document.all) { // IE
	    document.onmousemove = captureMousePosition;
	} else if (document.getElementById) { // NS 6
	    document.onmousemove = captureMousePosition;}});

// Hover Intent
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
