function pop_email_alert( link ) 
{
	// if( link > "" ) {
  //  	popupWindow = window.open( link, "email_alert", "width=700,height=500,left=0,top=0,scrollbars=1,resize=no" );
	// } else {
  popupWindow = window.open("http://ir2.flife.de/data/fantastic/fantastic_newsletter_e.php","email_alert","width=700,height=500,left=0,top=0,scrollbars=1,resize=no");
	// }
}

function popup(URL)
{
  	newWindow = window.open(URL, "", "width=550,height=600,resizable,scrollbars");
}

function newWin(URL)
{

	window.open(URL, "", "WIDTH=800,HEIGHT=600,status,resizable")

}


function pop_share_performance(URL) {
    popupWindow =window.open(URL,"request","width=590,height=520,left=0,top=0,scrollbars=1,resize=no");
	popupWindow.focus();
}


// set the z-order of an object
function setZIndex(obj, zOrder) {
	var theObj = getObject(obj)
	theObj.zIndex = zOrder
}



// convert object name string or object reference
// into a valid object reference ready for style change
function getObject(obj) {
	var theObj
	if (document.layers) {
		if (typeof obj == "string") {
			return document.layers[obj]
		} else {
			return obj
		}
	}
	if (document.all) {
		if (typeof obj == "string") {
			return document.all(obj).style
		} else {
			return obj.style
		}
	}
	if (document.getElementById) {
		if (typeof obj == "string") {
			return document.getElementById(obj).style
		} else {
			return obj.style
		}
	}
	return null
}

// set the visibility of an object to visible
function show(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "visible"
}

// set the visibility of an object to hidden
function hide(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "hidden"
}


//Ist auf 5 Menupunkte angepasst
function mouseOn(overMenu, menu2, menu3, menu4)
{
	if (document.images)
	{
		document.images[overMenu].src = "../images/but_fan_" + overMenu + "_over.gif"
		document.images[menu2].src = "../images/but_fan_" + menu2 + "_normal.gif"
		document.images[menu3].src = "../images/but_fan_" + menu3 + "_normal.gif"
		document.images[menu4].src = "../images/but_fan_" + menu4 + "_normal.gif"
	}
	var isMac = navigator.userAgent.indexOf("Mac") != -1
	if (!isMac) 
	{
		showHideMenu(overMenu)
	}
}

function showHideMenu(imgName)
{

	if (document.images)
	{
		switch(imgName)
			{
				case "aboutecdn":
				{
					show("subEcdn")
					hide("subProducts")
					hide("subCompany")
					hide("subNews")
					break
				}
				case "products":
				{
					show("subProducts")
					hide("subEcdn")
					hide("subCompany")
					hide("subNews")					
					break
				}
				case "company":
				{
					show("subCompany")
					hide("subEcdn")
					hide("subProducts")
					hide("subNews")					
					break
				}
				case "news":
				{
					show("subNews")
					hide("subEcdn")
					hide("subProducts")
					hide("subCompany")					
					break
				}
				case "index":
				{
					//resets everything
					hide("subEcdn")
					hide("subProducts")
					hide("subCompany")
					hide("subNews")
					document.images["aboutecdn"].src = "../images/but_fan_aboutecdn_normal.gif"
					document.images["products"].src = "../images/but_fan_products_normal.gif"
					document.images["company"].src = "../images/but_fan_company_normal.gif"
					document.images["news"].src = "../images/but_fan_news_normal.gif"				
					break
				}
					
			
			}
	
	}

}



function imageOn(imgName)
{
	
		if (document.images)
		{
			document.images[imgName].src = "../images/but_fan_" + imgName + "_over.gif"
		}
}

function imageOff(imgName)
{

		if (document.images)
		{
			document.images[imgName].src = "../images/but_fan_" + imgName + "_normal.gif"
		}
}

function checkform(objForm){
	var msg = "";

		if (objForm.firstName.value== ""){
		msg = "First Name\n"
		}

		if (objForm.lastName.value== ""){
		msg += "Last Name\n"
		}

		if (objForm.company.value== ""){
		msg += "Company\n"
		}

		if (objForm.addressLine1.value== ""){
		msg += "Address Line 1\n"
		}

		if (objForm.city.value== ""){
		msg += "City\n"
		}

		if (objForm.postalCode.value== ""){
		msg += "Postal code\n"
		}

		if (objForm.country.value== ""){
		msg += "Country\n"
		}

		if (objForm.phone.value== ""){
		msg += "Phone\n"
		}

		if (objForm.emailAddress.value== ""){
		msg += "Email Address\n"
		}

		if(msg != "")
		{
			alert("Please complete the following fields:\n\n" + msg)
			return false
		}
		else
		{
			return true
		}

	}	

var sub_window;
function openSubWindow(url, width, height) {
  x=(640-width)/2,y=(480-height)/2;
  if (screen) {
    y=(screen.availHeight-height)/2;
    x=(screen.availWidth-width)/2;
  }
  if (screen.availWidth>1800) {
    x=((screen.availWidth/2)-width)/2;
  }
  sub_window = window.open(url,'newErrorWindow','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x+',scrollbars=yes');
}
