// The rollover script for an image
//=================================
function rollImage(imageName,imageScr){
    if(!editMode){
        var i = document.images[imageName]
        i.oSrc = i.src;
        i.src = imageScr;
    }
}
// The restore rollover script for an image
//=========================================
function restoreImage(imageName){
    if(!editMode) {
        var i = document.images[imageName]
        i.src = i.oSrc;
    }
}
// For creating a PopUp window
//============================
function openWindow(pageUrl,pageName,params){
    window.open(pageUrl,pageName,params)
}
// Universal flash detection (Returns true or false)
//==================================================
function CheckForFlash(){
    var gotPlugin = false;
    var appName = navigator.appName;
    var appVersion = navigator.appVersion;
    if (appName.indexOf('Microsoft')!=-1){
        if(appVersion.indexOf('MSIE')!=-1) gotPlugin = true; // No point in checking.
        if(appVersion.indexOf('Mac')!=-1 && navigator.plugins['Shockwave Flash']) gotPlugin = true;
    }
    if (appName.indexOf('Netscape')!=-1 && navigator.plugins['Shockwave Flash']) gotPlugin = true;
    return gotPlugin;
}
// For inserting flash (Replaces image with flash is plugin found)
//================================================================
function replacewithFlash(obj,swfHeight,swfWidth,swfScr,imgSrc,flashVer){
    if (!editMode){
        var gotPlugin = CheckForFlash();
        if (gotPlugin) {
            var flashHTML = ''
                          + '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ flashVer +'" width="'+ swfWidth +'" height="'+ swfHeight +'">'
                          + '<PARAM name=movie value="'+ swfScr +'">'
                          + '<PARAM name=quality value=high>'
                          + '<PARAM name=SCALE value=exactfit>'
                          + '<PARAM name=menu value=false>'
                          + '<EMBED src="'+ swfScr  +'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+ swfWidth +'" height="'+ swfHeight +'"></EMBED>'
                          + '</OBJECT>'
             try{obj.outerHTML = flashHTML}catch(e){};
        }
    }
}
// For all forms
//====================================================================
function submitForm(frmObj){
    var errorList = ""
    var elArray = frmObj.elements
    var errorMessage = "Sorry, the following are required:\n"
    if(frmObj.errorMessage) errorMessage = frmObj.errorMessage +"\n"
    for(var i=0; i<elArray.length; i++){
       if(elArray[i].isRequired && elArray[i].isRequired=="yes"){
           if(elArray[i].value==""){
               if(elArray[i].displayName){
                   errorList += elArray[i].displayName +"\n"
                }else{
                   errorList += elArray[i].name +"\n"}
           }
       }
    }
    if(errorList == "") frmObj.submit();
    else alert(errorMessage +""+ errorList);
}

/* -----------------------------------------------
   MyPageStats - v.2.2.5
  ------------------------------------------------ */

// ----------------------------------------------------------
// SETTINGS:
// here should be your username you received from www.mypagestats.com
// Do not edit this file manually!! Use the one you downloaded
// from MyPageStats's settings section.
   id = "esarbica";
// If you're using a frameset and are not getting correct 
// referrers, please uncomment the following line:
   // pp_frames = true;
// ----------------------------------------------------------


// define some defaults -------------------------------------
if(showme==null) var showme='y';
if(st==null)     var st='js';    // st means show-type


// get the user agent name ----------------------------------
v = navigator.appName;

// get the screen resolution --------------------------------
c=0;
if (v != "Netscape") c = screen.colorDepth;
else c = screen.pixelDepth;

// get the screen size --------------------------------------
s = screen.width+"x"+screen.height;

// get the document's title ---------------------------------
t = escape(document.title);

// get the document's referrer -------------------------------
var f = "";

// if pp_frames is true then try getting the framed referral (without error checking)
if (typeof(pp_frames) != "undefined")
	if (pp_frames)
		f = top.document.referrer;

// get the referral for non-multi-domained-framed sites using a Netscape browser
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	if (document["parent"] != null) 
		if (parent["document"] != null) // ACCESS ERROR HERE!
			if (parent.document["referrer"] != null) 
				if (typeof(parent.document) == "object")
					f = parent.document.referrer; 

// get the referral for the current document if a framed referral wasn't found
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	if (document["referrer"] != null) 
		f = document.referrer;

// convert all the unknown's into blank
if ((f == "") || (f == "[unknown origin]") || (f == "unknown") || (f == "undefined"))
	f = "";

// escape the referral
f = escape(f);

// getting data ready to send -------------------------------
r="?id="+id+"&referer="+f+"&r="+s+"&c="+c+"&showme="+showme+"&st="+st+"&title="+t;

// adding logid if called by st='phpjs'
if(jslogid==null) var jslogid = 0;
else r = r + "&jslogid="+jslogid;


if (st=='js') { // calling MyPageStats by JavaScript-tag
	if (v != "Microsoft Internet Explorer") {
		r = r+"&url="+document.URL; // $HTTP_REFERER problem with NS,...
	}
	document.open();
	document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.mypagestats.com/mypagestats.php"+r+"\"></script>");
	document.close();
} else { // calling MyPageStats by IMG-tag
	rand = Math.round(1000*Math.random());
	r = r+"&b="+rand;  //force the page to load the IMG
	document.open();
	document.write("<img src=\"http://www.mypagestats.com/mypagestats.php"+r+"\" alt=\"\" border=\"0\">");
	document.close();
}
