function generate_address( username, hostname, subject ) {
  var domain = ".com";
  var atsign = "&#64;";
  var addr = username + atsign + hostname + domain;
  document.write( 
	"<" + "a" + " " + "href=" + "mail" + "to:" + addr + "?subject=" + subject + ">" +
	addr +
	"<\/a>");
}

function manifestElementControl(whichElement,whichFunction,whichProperty,whichValue){
	//alert ('clicked!');
	var ns6 = document.getElementById && !document.all;
	var ie = document.all;
	
	var whichElementArray = whichElement.split(",");
	var whichFunctionArray = whichFunction.split(",");
	var whichPropertyArray = whichProperty.split(",");
	var whichValueArray = whichValue.split(",");

	for(var i=0; i<whichElementArray.length; i++){
		if(ie){
			if(whichFunctionArray[i] == "setTEXT"){	eval("document.all."+whichElementArray[i]).innerHTML = whichValueArray[i];}
		}
		else if(ns6){
			if(whichFunctionArray[i] == "setTEXT"){	document.getElementById(whichElementArray[i]).innerHTML = whichValueArray[i];}
		}
	}
}


function btnHover(theid, repos) {
  var x=document.getElementById(theid);
  x.style.backgroundPosition="0 " + repos;
}

function btnHover2(theid, reposx, reposy) {
  var xx=document.getElementById(theid);
  xx.style.backgroundPosition= reposx + " " + repos;
}

var timerID;

function HideTimedLayer()
{  
    clearTimeout(timerID);
    document.getElementById('viewsouth').style.backgroundPosition="0 70px";
	document.getElementById('viewnorth').style.backgroundPosition="0 70px";
	document.getElementById('viewsouthbtn').style.backgroundPosition="0 0";
	document.getElementById('viewnorthbtn').style.backgroundPosition="0 0";
}

function timedLayer()
{
  document.getElementById('viewsouthbtn').style.backgroundPosition="50% 100%";
  document.getElementById('viewnorthbtn').style.backgroundPosition="50% 100%";
  setTimeout("HideTimedLayer()", 7000); //5000= 5 seconds
}


function playHover() {
  var x=document.getElementById('playslideshow');
  var BgPos = $style("playslideshow", "background-position");
  if (BgPos == '0px 0px') {
	  x.style.backgroundPosition="-72px 0";
	} else {
	  x.style.backgroundPosition="-72px 100%";
	}
  var y=document.getElementById('tip_rotation');
  y.style.visibility="visible";
}

function playOut() {
  var x=document.getElementById('playslideshow');
  var BgPos2 = $style("playslideshow", "background-position");
  if (BgPos2 == '-72px 0px') {
	  x.style.backgroundPosition="0 0";
	} else {
	  x.style.backgroundPosition="0 100%";
	}
  var y=document.getElementById('tip_rotation');
  y.style.visibility="hidden";
}


function $style(ElementId, CssProperty)
{
    function $(stringId)
    {
        return document.getElementById(stringId);
     }   

    if($(ElementId).currentStyle)
   {
        var convertToCamelCase = CssProperty.replace(/\-(.)/g, function(m, l){return l.toUpperCase()});
		// IE has only backgroundPositionX and backgroundPositionY
		if 	(convertToCamelCase == 'backgroundPosition')
			return	$(ElementId).currentStyle['backgroundPositionX'] + ' ' + $(ElementId).currentStyle['backgroundPositionY'];
        return $(ElementId).currentStyle[convertToCamelCase];
    }
    else if (window.getComputedStyle)
   {
        var elementStyle = window.getComputedStyle($(ElementId), "");
        return elementStyle.getPropertyValue(CssProperty);
    }
}

function switchDiv(this_div)
{
  var over = document.getElementById("over");
  var tech = document.getElementById("tech");
  var attr = document.getElementById("attr");
  if (this_div == "over") {	 
    over.style.display='block';
	tech.style.display='none';
	attr.style.display='none';
  } else if (this_div == "tech") {
    over.style.display='none';
	tech.style.display='block';
	attr.style.display='none';  
  } else if (this_div == "attr") {
    over.style.display='none';
	tech.style.display='none';
	attr.style.display='block';  
  }
}

function pushbutton() {
	alert("Media Kit will be available soon!");
}
