// STANDARD FUNCTIONS
window.onLoad = PreloadIMG;
function PreloadIMG(){MM_preloadImages("images/but_welcome2.gif","images/but_gallery2.gif","images/but_hiring2.gif","images/but_shop2.gif","images/but_invites2.gif","images/but_specials2.gif","images/but_contact2.gif","images/popdiv/close.png","images/popdiv/bottom.png","images/popdiv/bottomleft.png","images/popdiv/bottomright.png","images/popdiv/left.png","images/popdiv/right.png","images/popdiv/top.png","images/popdiv/topleft.png","images/popdiv/topright.png","images/popdiv/loading.gif","images/popdiv/loading_small.gif");}
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_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_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); 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];}}

// Disable selection - start
//document.onselectstart = function() {return false;} // ie
//document.onmousedown = function() {return false;} // mozilla
// Disable selection - end

// STANDARD FUNCTIONS - Div Pop-up Functions
var posx;var posy;
var xmlhttp_divpopup;
window.onMouseMove = mouser;
function GetXmlHttpObject(){if (window.XMLHttpRequest){return new XMLHttpRequest();}if (window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}return null;}
function mouser(event){posx = event.clientX;posy = event.clientY;}
function divpopup(themethod,theurl,qStr,divID,atclicksend){if (themethod.length == 0 || theurl.length == 0 || divID.length == 0){return;} else {CreatePopDiv(divID);}if(atclicksend){MoveDivToClick(divID);}xmlhttp_divpopup = GetXmlHttpObject();if (xmlhttp_divpopup == null){alert ("Your browser does not support XMLHTTP!");return;}xmlhttp_divpopup.onreadystatechange = function(){if (xmlhttp_divpopup.readyState == 1){dispload(divID,"","w");}if (xmlhttp_divpopup.readyState == 4){GetElm(divID).innerHTML = xmlhttp_divpopup.responseText;}};xmlhttp_divpopup.open(themethod,theurl + '?d=' + divID + qStr,true);xmlhttp_divpopup.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');xmlhttp_divpopup.send(theurl);}
function CreatePopDiv(divID){if(!GetElm(divID)){var oDiv = document.createElement("div");oDiv.className = 'PopDiv';oDiv.name = 'PopDiv';oDiv.id = divID;document.body.appendChild(oDiv);}BringToFront(divID);}	
function dispload(divID,Msg,dw){var loadingpic = "<center><div class=\"loadingpic\"></div></center>";var loadingwindow = "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" onmousedown=\"javascript:BringToFront('" + divID + "');\">";loadingwindow += "<tr><td class=\"PopDivFrameTopLeft\"></td><td class=\"PopDivFrameTop\"></td><td class=\"PopDivFrameTopRight\"></td></tr>";loadingwindow += "<tr><td class=\"PopDivFrameLeft\">&nbsp;&nbsp;&nbsp;</td><td class=\"PopDivFrameBg\">";loadingwindow += "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"width: 100%;\">";loadingwindow += "<tr><td class=\"popDivTopBar\" onmousedown=\"return MoveDiv('" + divID + "');\" onmouseup=\"return StopDiv('" + divID + "');\">";loadingwindow += "<table cellpadding=\"2\" cellspacing=\"0\" border=\"0\" style=\"width: 100%;\">";loadingwindow += "<tr><td style=\"text-align: left; font-size: 14px; color: #ffffff;\"><b>Loading...</b></td>";loadingwindow += "<td style=\"text-align: right;\"><input type=\"button\" class=\"popDivCloseBut\" value=\" \" title=\"close\" onclick=\"javascript:ClosePopDiv('" + divID + "');\" /></td></tr>";loadingwindow += "</table>";loadingwindow += "</td></tr>";loadingwindow += "<tr><td style=\"width: 200px; height: 100px; vertical-align: middle; text-align: center;\">" + loadingpic + "</td></tr>";loadingwindow += "</table>";loadingwindow += "</td><td class=\"PopDivFrameRight\">&nbsp;&nbsp;&nbsp;</td></tr>";loadingwindow += "<tr><td class=\"PopDivFrameBottomLeft\"></td><td class=\"PopDivFrameBottom\"></td><td class=\"PopDivFrameBottomRight\"></td></tr>";loadingwindow += "</table>";if(dw=="d"){GetElm(divID).innerHTML = "<center>" + loadingpic + "<br/><b>" + Msg + "</b></center>";}else if(dw=="w"){GetElm(divID).innerHTML = loadingwindow;}}
function dispload_small(divID){var loadingpic = "<div class=\"loadingpic_small\"></div>";GetElm(divID).innerHTML = loadingpic;}
function MoveDivToClick(divID){if (!posx){posx = 150;}if (!posy){posy = 50;}var moveX = posx;var moveY = posy;GetElm(divID).style.left = moveX + "px";GetElm(divID).style.top = moveY + "px";}
function BringToFront(divID){DropDivsZIndex();GetElm(divID).style.zIndex = 2;}
function DropDivsZIndex(){var divs = document.getElementsByTagName('div');for (var i=0;i<divs.length;i++){if (divs[i].className == 'PopDiv'){var d_ID = divs[i].id;GetElm(d_ID).style.zIndex = 1;}}}
function MoveDiv(divID){dsblSlct(document.body,divID);var DivClkLft = posx - GetElm(divID).offsetLeft;var DivClkRgt = posy - GetElm(divID).offsetTop;document.onmousemove = MovemyDiv;function MovemyDiv(){var moveX = posx - DivClkLft;var moveY = posy - DivClkRgt;GetElm(divID).style.left = moveX + "px";GetElm(divID).style.top = moveY + "px";}}
function StopDiv(divID){enblSlct(document.body,divID);document.onmousemove = function(){return;};}
function ClosePopDiv(divID){document.body.removeChild(GetElm(divID));}
function dsblSlct(trgt,divID){if (typeof trgt.onselectstart!="undefined"){trgt.onselectstart=function(){return false};}else if (typeof trgt.style.MozUserSelect!="undefined"){trgt.setAttribute("class","moznone");GetElm(divID).setAttribute("class","PopDivNotSelect");}else{trgt.onmousedown=function(){return false};trgt.style.cursor = "default";}}
function enblSlct(trgt,divID){if (typeof trgt.onselectstart!="undefined"){trgt.onselectstart=function(){return true};}else if (typeof trgt.style.MozUserSelect!="undefined"){trgt.setAttribute("class","moztext");GetElm(divID).setAttribute("class","PopDiv");}else{trgt.onmousedown=function(){return true};trgt.style.cursor = "select";}}
function getStyle(oElm, strCssRule){var strValue = "";if(document.defaultView && document.defaultView.getComputedStyle){strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);}else if(oElm.currentStyle){strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){return p1.toUpperCase();});strValue = oElm.currentStyle[strCssRule];}return strValue;}
function disp(div){GetElm(div).style.display="block";}
function hide(div){GetElm(div).style.display="none";}
function confirmAct(){var conf = confirm("Are you sure you want to take this action?");if(true == conf){return true;}else if(false == conf){return false;}}
function confirmDel(){var conf = confirm("Are you sure you want to delete the selected items?");if(true == conf){return true;}else if(false == conf){return false;}}
function fixForURL(val){return escape(encodeURI(val));}
function GetElm(fld){return document.getElementById(fld);}
function GetElmVal(fld){if(GetElm(fld)){return GetElm(fld).value;}}
function Trim(s) {while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r')){ s = s.substring(1,s.length); }while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r')){ s = s.substring(0,s.length-1); }return s;}
function PopWindow(url,name,h,w,left,top) {var optiontxt;optiontxt = "height=" + h + ",width=" + w + ",left=" + left + ",top=" + top + ",status=0,location=0,scrollbars=1,toolbar=0,resizable=1";window.open(url,name,optiontxt);}


