/************************************************************************************/
/*							Email valid											*/
/************************************************************************************/
function validMail(str){
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if(str.indexOf(at)==-1){return false;}
	if(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){return false;}
	if(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){return false;}
	if(str.indexOf(at,(lat+1))!=-1){return false;}
	if(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false;}
	if(str.indexOf(dot,(lat+2))==-1){return false;}	
	if(str.indexOf(" ")!=-1){return false;}
	return true;		
}


/************************************************************************************/
/*							ERROR HANDLING											*/
/************************************************************************************/
function clearError(){
	var errormessage = document.getElementById('errormessage');
	errormessage.innerHTML = "";
}

function showError(newError){
	var errormessage = document.getElementById('errormessage');
	errormessage.innerHTML = newError;
}
/************************************************************************************/
/*							Lay out											*/
/************************************************************************************/
  function setResolution() {
           w =  window.screen.availWidth;
           h = window.screen.availHeight;
           window.resizeTo(w,h);
           window.moveTo(0,0);
		   window.focus();
  }

  function writeEmailAddress(nme, dom, cou, cla){
           document.write("<a href='mailto:"+nme+"@"+dom+"."+cou+"' class="+cla+" >"+nme+"@"+dom+"."+cou+"</a>");
  }
  
  function changeTitle(tit){
			parent.document.title = tit;
  }
  function setSize(minW, minH){
	if(document.body.clientHeight<minH){
		document.getElementById("flashcontent").style.height = minH-1+"px";
		document.getElementById("foot").style.top ="680px";
	} else {
		document.getElementById("flashcontent").style.height = "100%";
		document.getElementById("foot").style.top = (document.getElementById("flashcontent").clientHeight-20)+"px";
	}
	if(document.body.clientWidth<minW){
		document.getElementById("flashcontent").style.width = minW-1+"px";
	} else {		
		document.getElementById("flashcontent").style.width = "100%";
	}
	void(0);
  }
  //on resize check minimum dimensions
  window.onresize=function(){setSize(1000,730);};
 