isOpera = 0;
isOpera6 = 0;
isOpera7 = 0;
isOpera8 = 0;
isOpera9 = 0;
isNetscape4 = 0;
isMozilla = 0;
isDOM=(document.getElementById)?1:0;//DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=(window.opera && isDOM)?1:0;//Opera 5+
isOpera6=(isOpera && window.print)?1:0; //Opera 6+
isOpera7=(isOpera && document.readyState)?1:0 ;//Opera 7+
isMSIE=(document.all && document.all.item && !isOpera)?1:0; //Microsoft Internet Explorer 4+
isMSIE5=(isDOM && isMSIE)?1:0; //MSIE 5+
isNetscape4=(document.layers)?1:0; //Netscape 4.*
isMozilla=(isDOM && navigator.appName=="Netscape")?1:0; //Mozilla eee Netscape 6.*

var nn=0;
var oo=0;
var mn_h=0;
if(navigator.appName=="Netscape"){nn=1}
nav=navigator.userAgent;k=nav.indexOf("O");// Opera
if(k>1){oo=1}
var mn=document.getElementById("mn_60");
var mn_cur="";
var mn_width=166;
var t1="";//interval;
var t2="";//interval;
function mnSHOW(n){
        clearInterval(t2);
        //if(n!=2&&mn_cur!=n){
        if(mn_cur!=n){
                w=document.body.clientWidth;
                mn_h=0;mn_cur=n;
                mn.style.display="none";
                clearInterval(t1);
                mn=document.getElementById("mn_"+n);
                if(navigator.appName=="Netscape" || isOpera || isOpera6 || isOpera7 || isOpera8 || isOpera9){
                        obj=document.getElementById("nn_"+n);
                        x=document.body.offsetLeft+obj.offsetLeft+obj.offsetParent.offsetLeft+obj.offsetParent.offsetParent.offsetLeft+obj.offsetParent.offsetParent.offsetParent.offsetLeft;
                       	//x=obj.name;
                        //alert(x);
		    }else{
                        x=event.x-event.offsetX;
                }
				if(typeof window.pageXOffset!='undefined'&&!oo){
				//Firefox
				}else{
				x+=document.body.scrollLeft;
				}
                if(x+mn_width>w){s=x+mn_width-w}else{s=15}
                mn.style.left=x-s+document.body.scrollLeft;
                mn.style.top=232;
                document.getElementById("tmn_"+n).style.top="-100px";
                mn.style.display="block";
                t1=setInterval("setH()",10);
}        }

function setH(){
        if(mn_h<100){
                mn_h+=4;
                document.getElementById("tmn_"+mn_cur).style.top=(-100+mn_h);
        }else{
                clearInterval(t1);
        }
}

function mnHIDE(){
        mn.style.display="none";
        mn_cur="";
}
function mnHIDE_2(){
        t2=setTimeout("mnHIDE()",100);
}
function bgON(obj){
        obj.style.backgroundColor="#007CAB";
        obj.style.color="#ffffff";
}

function bgOFF(obj){
        obj.style.backgroundColor="";
        obj.style.color="#1561A1";
}

function StartFlash(obj){
	if(window.sidebar){
	}
	else if(window.opera && window.print){
		document.getElementById('opera').innerHTML='<img src="/templates/artis/images/x.gif"  width="100%" height="119" alt="">';

	}
	else 
        {
	} 
}
function show(){
	
		var layer = document.getElementById("layerShadow");
		var win	  = document.getElementById("questionLayer");
		var img	  = document.images["bg"];
		
		var h_pos = document.body.clientWidth/2 - 182;
		var v_pos = document.body.scrollTop + 60; // document.body.clientHeight/2 - win.height/2;

		win.style.left = h_pos;
		win.style.top  = v_pos;
		
		layer.style.width  = document.body.clientWidth;
		layer.style.height = 1000;		
		
		img.width  = document.body.clientWidth;
		img.height = 2900;
		
		enableAlphaImages();
		
		win.style.display   = "block";
		layer.style.display = "block";
}
function show_send(){
	
		var layer = document.getElementById("layerShadow");
		var win	  = document.getElementById("sendLayer");
		var img	  = document.images["bg"];
		
		var h_pos = document.body.clientWidth/2 - 182;
		var v_pos = document.body.scrollTop + 260; // document.body.clientHeight/2 - win.height/2;

		win.style.left = h_pos;
		win.style.top  = v_pos;
		
		layer.style.width  = document.body.clientWidth;
		layer.style.height = 1000;		
		
		img.width  = document.body.clientWidth;
		img.height = 2900;
		
		enableAlphaImages();
		
		win.style.display   = "block";
		layer.style.display = "block";		
		
  	    setTimeout("hide_send();",5000);
		
}
function hide(){
	
		var layer = document.getElementById("layerShadow");
		var win	  = document.getElementById("questionLayer");
		
		win.style.left = 0;
		win.style.top  = 0;
		
		img.width  = 0;
		img.height = 0;
		
		win.style.display	= "none";
		layer.style.display = "none";
}
function hide_send(){
	
		var layer = document.getElementById("layerShadow");
		var win	  = document.getElementById("sendLayer");
		
		win.style.left = 0;
		win.style.top  = 0;	
		
		win.style.display	= "none";
		layer.style.display = "none";
}
function enableAlphaImages(){
		var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
		var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	
		var img = document.images["bg"];
	
		isDOM = document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
		isOpera = isOpera5 = window.opera && isDOM //Opera 5+
		isMSIE = document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
		isMSIE5 = isDOM && isMSIE //MSIE 5+
	
		if (isMSIE5)
		{
			img.src = "/templates/summer/images/bg.png";
			document.getElementById("layerShadow").filters.Alpha.opacity = 30;
		}
}
function applyBannerZone(str) {
		for (var i = 0; i < document.forms.length; ++i) {
			if (document.forms[i].posted != null) {
				document.forms[i].posted.value = str;
			}
		}
}
function presubmit(f){
	     reg=/[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-\.]+\.[a-zA-Z]+/;
		 result = reg.test(f.email.value);
		 
	 	 if (f.username.value == ''){
		    f.username.focus();
			return false;
		 }
		 if (!result){ 
		    f.email.focus(); 
		    return false; 
		 }
		 if (f.phone.value == '') {
		     f.phone.focus(); 
			 return false;
		 }
		 if (f.textbody.value == '') {
		    f.textbody.focus(); 
			return false;
		 }
		 hide();
		 
		 return true;
}
