function stopError() {		
	return true;
}
window.onerror=stopError;

flyerisoff=0;
clickedonflyer=0;

getId = (document.getElementById) ? 1:0;
docAll = (document.all) ? 1:0;

function getObj(name){
	if(getId){
		return document.getElementById(name);
	}else if(docAll){
		return document.all[name];
	}
}

function correctPNG(iii) {
	if (document.all && (navigator.appName.indexOf("Opera")==-1)) {
		
		s_fuckIE=1;
		var img = document.images[''+iii]
		var imgName = img.src.toUpperCase()
		var imgName = img.src.toUpperCase()
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			 var imgID = (img.name) ? "id='" + img.name + "' " : ""  // spezial hier.. der name wird die ID !!
			 var imgClass = (img.className) ? "class='" + img.className + "' " : ""
			 var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
			 var imgStyle = "display:inline-block;" + img.style.cssText 
			 if (img.align == "left") imgStyle = "float:left;" + imgStyle
			 if (img.align == "right") imgStyle = "float:right;" + imgStyle
			 if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle		
			 var strNewHTML = "<span " + imgID + imgClass + imgTitle
			 + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			 + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			 + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
			 img.outerHTML = strNewHTML
		 }
	}
}
	
function showMap() {
	obj=getStyle("themap");
	obj.display="block"
}

function noShit() {
	var ok = false;
	if (document.newsletter.mailadr.value.indexOf("@") == -1 || document.newsletter.mailadr.value.indexOf(".") == -1)
	{
		document.newsletter.mailadr.value="NO TRASH PLEASE.";
	}
	else if (document.newsletter.mailadr.value.indexOf("hotmail.com.mx")!=-1)
	{
		document.newsletter.mailadr.value="HOTMAIL.COM.MX doesn't exist, it's HOTMAIL.COM !";
		ok = false;
	}
	else
	{
		ok = true;
	}
	return ok;
}

function getNewsletter() {
	if (noShit()) {
		document.newsletter.submit();
	}
}

function noSpam(who,domain) {
	str = "mailto:" + who + "@" + domain;
	window.location = str;
}

function makeDollars() {
	setTimeout("clearrRRRrrScroll()",2000); // spezial fuer $$$
}

john1_count=0;	
john2_count=0;
john3_count=0;
	
function john() {

	// flyer 1
	setTimeout("john1OnOff()",3000);
	setTimeout("john1OnOff2()",15000);
	
	// flyer 2
	setTimeout("john2OnOff()",10000);
	setTimeout("john2OnOff2()",20000);
	
	// flyer 3
	//setTimeout("john3OnOff()",3000);
	//setTimeout("john3OnOff2()",17000);
	
}


// FLYER 1 ==========================================================
function john1OnOff() {

	if (john1_count<=4) {
	
		if (john1_count % 2==0) {
			MM_showHideLayers('flyer1','','show');
		} else {
			MM_showHideLayers('flyer1','','hide');
		}
		john1_count++;
		setTimeout("john1OnOff()",10);
	
	} else {
		MM_showHideLayers('flyer1','','show');
		john1_count=0;
	}
}

function john1OnOff2() {
	if (john1_count<=5 && flyerisoffA==0 && noMoreJohn==0) {
	
		if (john1_count % 2==0) {
			MM_showHideLayers('flyer1','','show');
		} else {
			MM_showHideLayers('flyer1','','hide');
		}
		john1_count++;
		setTimeout("john1OnOff2()",10);
	
	} else {
		MM_showHideLayers('flyer1','','hide');
		john1_count=0;
		flyerisoffA=1;
		
	}
}

// FLYER 2 ==========================================================

function john2OnOff() {

	if (john2_count<=4) {
	
		if (john2_count % 2==0) {
			MM_showHideLayers('flyer2','','show');
		} else {
			MM_showHideLayers('flyer2','','hide');
		}
		john2_count++;
		setTimeout("john2OnOff()",10);
	
	} else {
		MM_showHideLayers('flyer2','','show');
		john2_count=0;
	}
}

function john2OnOff2() {
	if (john2_count<=5 && flyerisoffB==0 && noMoreJohn==0) {
	
		if (john2_count % 2==0) {
			MM_showHideLayers('flyer2','','show');
		} else {
			MM_showHideLayers('flyer2','','hide');
		}
		john2_count++;
		setTimeout("john2OnOff2()",10);
	
	} else {
		MM_showHideLayers('flyer2','','hide');
		john2_count=0;
		flyerisoffB=1;
		
	}
}

// FLYER 3 ==========================================================

function john3OnOff() {
	if (john3_count<=4) {
	
		if (john3_count % 2==0) {
			MM_showHideLayers('flyer3','','show');
		} else {
			MM_showHideLayers('flyer3','','hide');
		}
		john3_count++;
		setTimeout("john3OnOff()",10);
	
	} else {
		MM_showHideLayers('flyer3','','show');
		john3_count=0;
	}
}

function john3OnOff2() {
	if (john3_count<=5 && flyerisoffC==0 && noMoreJohn==0) {
	
		if (john3_count % 2==0) {
			MM_showHideLayers('flyer3','','show');
		} else {
			MM_showHideLayers('flyer3','','hide');
		}
		john3_count++;
		setTimeout("john3OnOff2()",10);
	
	} else {
		MM_showHideLayers('flyer3','','hide');
		john3_count=0;
		flyerisoffC=1;
	}
}




function MM_findObj(n, d) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}



s_scrollactive=0;
s_cRRRRRactive=0;

c_delay=140;
s_fuckIE=(document.all) ? 1:0;
	
	
function clearrRRRrrScroll() {
		//s_layers=10; // AMOUNT OF IMAGES
		//s_aspect=0.49097;
		s_speeds=new Array;
		s_pos=new Array;
		s_startpos=1400;
		s_scrollactive=1
		setTimeout("cScrollthem1()",c_delay);
}

function cScrollthem1() {
	
	for (i=1; i<=s_layers; i++) {
			s_speeds[i]=Math.round(Math.random()*10)+5; // ran speed
			s_pos[i]=s_startpos;

			obj=getObj('logo'+i);
			obj.style.visibility="visible";
			tLeft=Math.round(Math.random()*1400)-Math.round(Math.random()*600)+200;
			obj.style.left=tLeft+'px';
			obj.style.top=s_startpos+'px';
			im = eval('document.' + 'logo'+i+'i');
			if (!s_fuckIE) {
				tempW=Math.round(Math.random()*300)+20;
				im.width=tempW;
				im.height=Math.round(tempW/s_aspect);
			} else {
				im=getObj('logo'+i+'i');
				tempW=Math.round(Math.random()*300)+20;
				im.style.width=tempW;
				im.style.height=Math.round(tempW/s_aspect);
			}

		}
	setTimeout("cScrollthem()",10);
}

function cScrollthem() {

	tNotThere=0
	for (i=1; i<=s_layers; i++) {
		obj=getStyle('logo'+i);
		s_pos[i]-=s_speeds[i];
		obj.top=s_pos[i]+'px';
		if (s_pos[i]>-400) {
			tNotThere=1;
		}
	}
	
	if (tNotThere) {
		setTimeout("cScrollthem()",10);
	} else {
		for (i=1; i<=s_layers; i++) {
			obj=getObj('logo'+i);
			obj.style.visibility="hidden";
		}
		s_scrollactive=0
	}
	
}