var sent = false;
var strSVIDate;
var oNow = new Date();
var iNowDay = oNow.getDay();
var iNowHours = oNow.getHours();
var iNowMinutes = oNow.getMinutes();
var iNowYear = oNow.getYear();
var iNowMonth = oNow.getMonth();
var iNowDayOfMonth = oNow.getDate();
var arrDays = new Array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
var strDayToday = arrDays[iNowDay-1];

flashVersion_DONTKNOW = -1;

if (iNowDayOfMonth <= 9){
	iNowDayOfMonth = "0" + iNowDayOfMonth;
}
if (iNowMonth <= 9){
	iNowMonth = "0" + iNowMonth;
}
if (iNowMinutes <= 9){
	iNowMinutes = "0" + iNowMinutes;
}

strSVIDate = strDayToday + " " + iNowYear + "." + iNowMonth + "." + iNowDayOfMonth + "<br>" + iNowHours + ":" + iNowMinutes + " PM GMT+2";

var strUserAgent = navigator.userAgent;

function popupLink(sURL) {
	window.open("/imagewindow.asp?disp=" + escape(sURL), "popuplink", "height=350,width=400,status=no,top=100,left=200,marginheight=0,marginwidth=0,scrollbars=1,toolbar=no,menubar=no,location=no,resizable=1");
}

function topMenuHighLight(obj){
	if (document.all && strUserAgent.indexOf("Win") != -1){
		objID = obj.uniqueID;
		if(document.all[objID]) {
			document.all[objID].className = "topMenuHL";
		}
	}
}

function topMenuLowLight(obj){
	if (document.all && strUserAgent.indexOf("Win") != -1){
		objID = obj.uniqueID;
		if(document.all[objID]) {
			document.all[objID].className = "topMenuLL";
		}
	}
}

function leftMenuHighLight(obj, sClassName){
	if (document.all && strUserAgent.indexOf("Win") != -1){
		objID = obj.uniqueID;
		document.all[objID].className = sClassName;
	}
}

function leftMenuLowLight(obj, sClassName){
	if (document.all && strUserAgent.indexOf("Win") != -1){
		objID = obj.uniqueID;
		document.all[objID].className = sClassName;
	}
}

function goTo(strLocation) {
	if (document.forms.navigationForm) {
		if (strLocation.indexOf("javascript:") > -1) {
			eval(strLocation);
		} else {
			document.forms.navigationForm.action = strLocation;
			document.forms.navigationForm.submit();
		}
	} else {
		if (strLocation.indexOf("javascript:") > -1) {
			eval(strLocation);
		} else {
			document.location = strLocation;
		}
	}
}


function openPopup(sUrl, sName, iWidth, iHeight, iLeft, iTop, bScroll) {
	var pos;
	
	if (sName == "") {
		sName = "popupWindow";
	}
	
	if (bScroll == true) {
		bScroll = 1;
	} else {
		bScroll = 0;
	}
		
   window.open(sUrl, sName, "left=" + iLeft + ",top=" + iTop + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + bScroll + ",resizable=0,copyhistory=0,width=" + iWidth + ",height=" + iHeight);
}

// Flash Version Detector  v1.1.4
// http://www.dithered.com/javascript/flash_detect/index.html
// code by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
// with VBScript code from Alastair Hamilton
agent = navigator.userAgent.toLowerCase();
function getFlashVersion() {
	if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
		return getFlashVersion1();
	} else {
		return getFlashVersion2();
	}
}

function getFlashVersion1() {
	flashVersion = -1;
	document.write('<scr' + 'ipt language="VBScript"\> \n');
	document.write('on error resume next \n');
	document.write('dim obFlash \n');
	document.write('set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.7") \n');
	document.write('if IsObject(obFlash) then \n');
	document.write('flashVersion = 7 \n');
	document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.6") end if \n');
	document.write('if flashVersion < 7 and IsObject(obFlash) then \n');
	document.write('flashVersion = 6 \n');
	document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.5") end if \n');
	document.write('if flashVersion < 6 and IsObject(obFlash) then \n');
	document.write('flashVersion = 5 \n');
	document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.4") end if \n');
	document.write('if flashVersion < 5 and IsObject(obFlash) then \n');
	document.write('flashVersion = 4 \n');
	document.write('else set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash.3") end if \n');
	document.write('if flashVersion < 4 and IsObject(obFlash) then \n');
	document.write('flashVersion = 3 \n');
	document.write('end if');
	document.write('</scr' + 'ipt\> \n');
	return flashVersion;
}

function getFlashVersion2() {
	flashVersion_DONTKNOW = -1;
	var flashVersion = flashVersion_DONTKNOW;
	// NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		var flashPlugin = navigator.plugins['Shockwave Flash'];
		if (typeof flashPlugin == 'object') { 
			if (flashPlugin.description.indexOf('7.') != -1) flashVersion = 7;
			else if (flashPlugin.description.indexOf('6.') != -1) flashVersion = 6;
			else if (flashPlugin.description.indexOf('5.') != -1) flashVersion = 5;
			else if (flashPlugin.description.indexOf('4.') != -1) flashVersion = 4;
			else if (flashPlugin.description.indexOf('3.') != -1) flashVersion = 3;
		}
	}

	// IE4+ Win32:  attempt to create an ActiveX object using VBScript
	
	// WebTV 2.5 supports flash 3
	else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

	// older WebTV supports flash 2
	else if (agent.indexOf("webtv") != -1) flashVersion = 2;

	// Can't detect in all other cases
	else {
		flashVersion = flashVersion_DONTKNOW;
	}

	return flashVersion;
}

function menuItemEffect(obj, sClassName){
	if (document.all && strUserAgent.indexOf("Win") != -1){
		objID = obj.uniqueID;
		document.all[objID].className = sClassName;
	}
}

function isMac() {
	return (navigator.userAgent.toLowerCase().indexOf("mac") != -1);
}

function cancelBubble() {
	if (event) {
		if (event.stopPropagation) {
			event.stopPropagation();
		} else {
			event.cancelBubble = true;
		}
	}
}

// If the user is trying to open the page in an external frameset, open a new window and close the opener.
// marcus.andersson@sublime.se 20030708
//
// Changed for EP4 2004-02-20 by Johan Bergens
/*if (document.frames.length > 0) {
// is IFRAME
	var frm = document.frames;
	for (i=0; i<frm.length; i++) {
		alert("IFRAME: " + frm(i).location);
	}
} else */
if (window.parent.frames.length > 0){
// is FRAME

	var blnExtFrames = false;
	var blnBreak = false;
	var frm = window.parent.frames;
	for (i=0; i<frm.length; i++) {
		if (window.name != "ep_work"){
			if (window.name != "headerFrame"){
				if (window.name != "navFrame") {
					if (window.name.indexOf("weather") < 0) {
						blnExtFrames = true
						break;
					}
				}
			}
		}
//alert("window.name = " + window.name);
		if (window.name != "EditPanel") {
			blnExtFrames = true;
			break;
		}
	}
// DEBUG 
// Turn off this check for the moment since it doesn't work
	/*
	if (blnExtFrames) {
		window.open(this.location);
		window.parent.close();
	}
	*/
}


// Added for dynamic handling of the flash area on the fron page for IE
// marcus.andersson@sublime.se 20030711
function getBrowserSize() {
	var myWidth = 0, myHeight = 0;
	if(typeof(window.innerWidth) == 'number') {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else {
		if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else {
			if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
				//IE 4 compatible
				myWidth = document.body.clientWidth;
				myHeight = document.body.clientHeight;
			} else {
				myWidth = document.body.offsetWidth;
				myHeight = document.body.offsetHeight;
			}
		}
	}
	return myWidth;
}
// abre pop up
function openWindow(URL, width, height, center) {
  xposition=0; yposition=0; 
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){ 
        xposition = (screen.width - width) / 2; 
        yposition = (screen.height - height) / 2; 
    } 
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0," 
    + "resizable=0," 
    + "scrollbars=1," 
    + "status=0," 
    + "titlebar=0," 
    + "toolbar=0," 
    + "hotkeys=0," 
    + "screenx=" + xposition + ","  //NN 
    + "screeny=" + yposition + ","  //NN 
    + "left=" + xposition + ","     //IE 
    + "top=" + yposition;           //IE 

window.open( URL , null , args ); 
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_preloadImages() { //v3.0
  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 doLoad(){
	openWindow('lwf.htm', 314, 218, true)
}

var winCistella;
function mostrar_imagen(URL,width,height) {
  if (winCistella!=null) {
   if (!winCistella.closed) {
     winCistella.close();
   }
  }
  winCistella=window.open(URL, 'winCistella', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width='+width+',height='+height);
}

function reemplaza(str){
	re = /http:\/\/([^\s;,)]*)/gi;
	rm = /([^\s;,(]*)@([^\s;,)]*)/gi;
	newstr = str.replace(re, "<a target='_blank' href='http://$1'>$1</a>");
	newstr = newstr.replace(rm, "<a href='mailto:$1@$2'>$1@$2</a>");
	document.write(newstr);
}

//-->