// JavaScript Document
var mItem = ['submenu1','submenu2','submenu3','submenu4','submenu5'];
var mInTime = [], mOutTime = []; 
var mWait = 100;
function mFocus(id) {
	for (var i = 0; i < mItem.length; i++) {
		if (document.getElementById(mItem[i]).style.display != 'none') {
			if (mItem[i] != id) mHide(mItem[i]);
			else mClear(mItem[i]);
		}
	}
	mInTime[id] = setTimeout('mShow(\'' + id + '\');', mWait);

}

function mShow(id) {
	document.getElementById(id).style.display = 'block';
	mInTime[id] = null;
}

function mHide(id) {
	mClear(id);
	document.getElementById(id).style.display = 'none';
}

function mBlur(id) {
	if(mInTime[id]) {
		clearTimeout(mInTime[id]);
		mInTime[id] = null;
	}
	mOutTime[id] = setTimeout('mHide(\'' + id + '\');', mWait);
}

function mClear(id) {
	if (mOutTime[id]) {
		clearTimeout(mOutTime[id]);
		mOutTime[id] = null;
	}
}
//////////////////////////////////////////////////////
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

///////////////////////////////////
var imgPath ="fileadmin/template/sub/images/";
function swapImg(id,url) { //custom
   document.getElementById(id).src=imgPath+url;
}

//////////////////////////////////////////////
function showsubmenu(num) {
	//var num;
	document.getElementById('submenu'+num).style.display = 'block';
}
function hidesubmenu(num) {
	//var num;
	document.getElementById('submenu'+num).style.display = 'none';
}

function showserversubmenu(num) {
	//var num;
	document.getElementById('serversubmenu'+num).style.display = 'block';
}
function hideserversubmenu(num) {
	//var num;
	document.getElementById('serversubmenu'+num).style.display = 'none';
}
function switch_bgcolor(urls,colors)
{
	
	obj3=document.getElementById(urls);
	obj3.style.background=colors;
}
function formCheck()
{
	if (document.form1.name.value.length == 0)
	{
		alert("Name can not be null!");
		document.form1.name.focus();
		return false;
	}
	 if (document.form1.email.value.length == 0)
  	{
		alert("Email can not be null!");
		document.form1.email.focus();
		return false;
	}
	else{
    	if (document.form1.email.value.charAt(0)=="." ||        
         document.form1.email.value.charAt(0)=="@"||       
         document.form1.email.value.indexOf('@', 0) == -1 || 
         document.form1.email.value.indexOf('.', 0) == -1 || 
         document.form1.email.value.lastIndexOf("@") ==document.form1.email.value.length-1 || 
		 document.form1.email.value.lastIndexOf(".")==document.form1.email.value.length-1)
     		{
				alert("format of E-mail is not correct.");
				document.form1.email.focus();
				return false;
     		 }
	}
	if (document.form1.comment.value.length == 0)
	{	
		alert("Commment can not be null!");
		document.form1.comment.focus();
		return false;
	}
	document.form1.submit();
}
function activeflash(i_flash,v_flash,filename)
{
	
	if (i_flash && v_flash>=8.0)
	{
		
				document.writeln("<div style=\"width:940px; height:201px;\"><embed src="+filename+" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"940\" height=\"201\"  ><\/embed><\/div>");
				
		
	}
}

function change_text(urls,words)
{
	obj3=document.getElementById(urls);
	obj3.innerHTML=words;
}
function change_flash(flashname,transparent)
{
	obj3=document.getElementById("bigimg");
	obj3.innerHTML="";
	if (transparent){
	obj3.innerHTML="<div style=\"padding-top:50px;\"><embed src=\"/fileadmin/template/flash/"+flashname+"\" quality=\"high\"  pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"251\" height=\"192\" wmode=\"transparent\"><\/embed><\/div>";
	}else{
	obj3.innerHTML="<div style=\"padding-top:50px;\"><embed src=\"/fileadmin/template/flash/"+flashname+"\" quality=\"high\"  pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"251\" height=\"192\"><\/embed><\/div>";
	}
}
var sFlag = 0;
var vFlag = 0;
var sItem;
function doShowHide() {
	if(sFlag == 0 && vFlag == 0) {
		document.getElementById('searchLink').className = 'altbg1';
		document.getElementById('searchBox').className = 'noshow';
		document.getElementById('tx_indexedsearch_sword').blur();
	} else {
		document.getElementById('searchLink').className = 'altbg2';
		document.getElementById('searchBox').className = 'show';
		sFocus();
	}
}
function sOver()
{
	sFlag = 1;
	vFlag = 1;
	clearTimeout(sItem);
	doShowHide();
}
function sOut() {
	sFlag = 0;
	sItem = setTimeout('doShowHide()',500);
}
function sFocus() {
	sFlag = 1;
	vFlag = 1;
	clearTimeout(sItem);
	doShowHide();
}
function sBlur() {
	vFlag = 0;
	sItem = setTimeout('doShowHide()',500);
}
function sFocus() {
	document.getElementById('tx_indexedsearch_sword').focus();
}
function sSelect() {
	document.getElementById('tx_indexedsearch_sword').focus();
	document.getElementById('tx_indexedsearch_sword').select();
}