// JavaScript Document
// f.pashaee javascript library 
// browser identification -------------------------------------------------------------------------------------------------------
 var jsl_BrowserName = navigator.appName;
 var jsl_BrowserInfo = navigator.appVersion;
 var jsl_BrowserVersion = parseFloat(navigator.appVersion);
 
 var jsl_BrowserID // 1:Microsoft Internet Explorer  ,2:Netscape (FireFox)
 if (jsl_BrowserName == 'Microsoft Internet Explorer'){
	 jsl_BrowserID = 1;
 } else if (jsl_BrowserName == 'Netscape') {
	 jsl_BrowserID = 2;
 }
// -----------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------------------------------------------
// iFrame functions -------------------------------------------------------------------------------------------------------------
// Attention! this object must use after iFrame tag in the HTML code
function newIFRAME(id,Width,Height){
 	newIFRAME = document.createElement("iFrame");
	newIFRAME.setAttribute("id", id);
	newIFRAME.setAttribute("Name", id);
	document.body.appendChild(newIFRAME);
	setHeight(id,Height);
	setWidth(id,Width);	
}
function iFrameLocation(id,srcURL){ 
    document.getElementById(id).src=srcURL;
}

//-------------------------------------------------------------------------------------------------------------------------------
// Div functions -------------------------------------------------------------------------------------------------------------
// Attention! this object must use after iFrame tag in the HTML code
function newDiv(id,Width,Height){
		newDiv = document.createElement("div");
		newDiv.setAttribute("id", id);
		newDiv.setAttribute("Name", id);
		newDiv.style.position = "absolute";
		document.body.appendChild(newDiv);
		setHeight(id,Height);
		setWidth(id,Width);	
}

function DivInnerHTML(id,Content){ 
	try{
 if(Content==null){
	return document.getElementById(id).innerHTML;
 } else {
 	document.getElementById(id).innerHTML=Content;
 }
 } catch(err) {
	alert(errorHandel(err));
  }
}

function Position(id,leftPosition,topPosition){
	try{
	document.getElementById(id).style.left=leftPosition+"px";		
	document.getElementById(id).style.top=topPosition+"px";	
	} catch(err) {
	alert(errorHandel(err));
  }
}

function leftPosition(id,leftPosition){
    document.getElementById(id).style.left=leftPosition+"px";	
}

function topPosition(id,topPosition){
	document.getElementById(id).style.top=topPosition+"px";
}

function show(id){
	document.getElementById(id).style.display="inline";
}
function hide(id){
	document.getElementById(id).style.display="none";
}
// All DHTML elements -----------------------------------------------------------------------------------------------------------

function setHeight(id,Height){
	document.getElementById(id).style.height=Height+"px";
}
function setWidth(id,Width){
 document.getElementById(id).style.width=Width+"px";
}

function getHeight(id){
	return document.getElementById(id).style.height;
}
function getWidth(id){
	return document.getElementById(id).style.width;
}
// set Style 
function setStyle(id,style,value){
	eval ("document.getElementById('"+id+"').style."+style+"='"+value+"'");
}

// Retrive DOM Object
function get(id){
	DomObject = document.getElementById(id);
	return DomObject;
}


// Ajax 
//------------------------------------------------------------------------------------------------------------------------------
if (jsl_BrowserID==1){
 httpXML = new ActiveXObject("Microsoft.XMLHTTP");
} else {
 httpXML = new XMLHttpRequest();	
}
var httpXMLState = "";
function updateData(URL,Method,DestinationID,params) {
  httpXML.open(Method,URL, true);
  if(Method=='POST'){
  	httpXML.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  	httpXML.setRequestHeader("Content-length", params.length);
  	httpXML.setRequestHeader("Connection", "close");
  }
  httpXML.onreadystatechange = function(){
	 if(httpXML.readyState==0){
		httpXMLState = "The request is not initialized";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==1){
		httpXMLState = "The request has been set up";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==2){
		httpXMLState = "The request has been sent";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==3){
		httpXMLState = "The request is in process";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==4){
		httpXMLState = "The request is complete";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	}   
    if (httpXML.readyState == 4) {
     result = httpXML.responseText;
	 document.getElementById(DestinationID).innerHTML=result;
   }
 }
 
 if(Method=='POST')
  httpXML.send(params);
  else
  httpXML.send(null);
}

function readFile(URL,Method) {
  httpXML.open(Method,URL, true);
  httpXML.onreadystatechange = function(){
	 if(httpXML.readyState==0){
		httpXMLState = "The request is not initialized";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==1){
		httpXMLState = "The request has been set up";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==2){
		httpXMLState = "The request has been sent";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==3){
		httpXMLState = "The request is in process";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	} else if (httpXML.readyState==4){
		httpXMLState = "The request is complete";
		//document.getElementById(StateView).innerHTML=httpXMLState;
	}   
    if (httpXML.readyState == 4) {
     result = httpXML.responseText;
	 alert(result);
	 
   }
 }
 
  httpXML.send(null);
}
// other functions
//---------------------------------------------------------------------------------------------------------------------------------
// special

 trPointer = -1;
 function liveSearch(evt,address){ 
  SearchSTR = document.getElementById('SearchField').value;
  if(jsl_BrowserID==1)
		keyPressed = window.event.keyCode; // IE
	else
		keyPressed = evt.which; // Firefox
		
  if(keyPressed ==13){
	  if(selectFlag == false){
		  window.location = 'http://www.ictn.ir/farsi/main/search.php?query='+SearchSTR;
	  } else {
		  window.location = 'http://www.ictn.ir/farsi/page.php?catID='+linksCat[trPointer]+'&page_id='+links[trPointer];
	  }
	  return 1;
  }

  selectFlag = false;
  if(SearchSTR=="" || SearchSTR.length<2 || keyPressed ==38 || keyPressed ==40 || keyPressed ==37 || keyPressed ==39){
	  if(keyPressed ==38 && trPointer!=0){
		selectFlag = true;
		document.getElementById('tr_'+trPointer).bgColor='#FFFFFF';
		trPointer--;
		document.getElementById('tr_'+trPointer).bgColor='#F4F4F4';
	  } else if(keyPressed ==40 && trPointer!=maxResult-1){
		selectFlag = true;
		  if(trPointer!=-1)
			document.getElementById('tr_'+trPointer).bgColor='#FFFFFF';
		trPointer++;
		document.getElementById('tr_'+trPointer).bgColor='#F4F4F4';
	  } else {
   		document.getElementById('SearchResults').style.display = "none";
	  }
	  
  } else {
	trPointer = -1;
    document.getElementById('Loading').style.display = "inline";
    document.getElementById('SearchResults').style.display = "inline";
    var time = new Date();
    temp = time.getTime();
    iFrameLocation("searchFrame",address+"scripts/AjaxSearch.php?query="+SearchSTR+"&temp="+temp);
   }
   
 }
 // clear all selected results higlight
 function clearAll(){
	 counter=maxResult;
	 while(counter>0){
		 document.getElementById('tr_'+(counter-1)).bgColor='#FFFFFF';
		 counter--;
	 }
 }
 
// Form functions 
// Email Validetor
function emailValid(field){
	EmailField = field;
	if ((EmailField.value==null)||(EmailField.value=="")){
		alert("Empty Email Field!");
		EmailField.focus()
		return false
	}
	var str=EmailField.value;
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
		  alert("Invalid E-mail ")
		  return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		  alert("Invalid E-mail ")
		  return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("Invalid E-mail ")
		   return false
	}

	if (str.indexOf(at,(lat+1))!=-1){
		   alert("Invalid E-mail ")
		   return false
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("Invalid E-mail ")
		   return false
	}

	if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ")
		   return false
	 }
		
	if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail")
		   return false
	}
	return true
}

// text field limite (Only Number) / Use on target TextField => onKeyPress="return numbersonly(this, event)"
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) || 
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

// style switch ----------------------------------------------------------
	function switchClass(itemName,classID){
		if(jsl_BrowserID==2)
			itemName.setAttribute('class', classID);
		else 
			itemName.setAttribute('className', classID);
		
	}
	
	function cbColor(id, color){
		document.getElementById(id).style.borderColor = color;
	}
	
// form value
function getValue(id){
		return document.getElementById(id).value;
}
//------------------------------------------------------------------------
temp = new Date();
rand = temp.getTime();
function SwitchTab(id,frame,srcURL) {
		var tabs_content = new Array("main","news","training","products","services","support","aboutus","contactus");
		show('tab_loading');
		
		$.ajax({
   			type: "GET",
   			url: srcURL+"?rand="+rand+"&ajax=true",
   			success: function(html){
				$("#div_Content").html(html);
				hide('tab_loading');
   			}
 		});
		
		for(i=0;i<tabs_content.length;i++){
			$("#td_"+tabs_content[i]).css('background-image','none');
		}
		$("#td_"+id).css('background-image','url(index_files/bar_pattern_highlight.png)');
		
}
	  
function getWindowHeight() {
  var windowHeight = 0;
	
  if (typeof(window.innerHeight) == 'number')
    windowHeight = window.innerHeight;
	
  else {
		
    if (document.documentElement && document.documentElement.clientHeight)
      windowHeight = document.documentElement.clientHeight;
		
    else {
      if (document.body && document.body.clientHeight)
        windowHeight = document.body.clientHeight; }; };
				
  return windowHeight;
};


function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return { winScrollX:scrOfX ,winScrollY:scrOfY };
}

function windowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return { winHeight:myHeight ,winWidth:myWidth };
}

function getPageSizeWithScroll(){     
if( window.innerHeight && window.scrollMaxY ){ // Firefox 
pageWidth = window.innerWidth + window.scrollMaxX;
pageHeight = window.innerHeight + window.scrollMaxY;
}else if( document.body.scrollHeight > document.body.offsetHeight ){// all but Explorer Mac
pageWidth = document.body.scrollWidth;
pageHeight = document.body.scrollHeight;
} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
pageWidth = document.body.offsetWidth + document.body.offsetLeft;
pageHeight = document.body.offsetHeight + document.body.offsetTop;
}       
return { pageWidthS:pageWidth ,pageHeightS:pageHeight };     
} 

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return { pageWidthS:myWidth ,pageHeightS:myHeight };     
}

// mouse monitor -----------------------------------------------------------------------------------------------------------

//document.onmousemove = mouseMove;
// document.onmousedown =  mouseDown; 
document.onmouseup   = mouseUp; 
var mousePos = null;
var DragIntervalID = null;
var Drag = false;
var CurrentWinSize = null;
var CurrentWinScroll = null;

function mouseMove(ev){
	 ev = ev || window.event; 
	 CurrentWinSize = windowSize();
	 CurrentWinScroll = getScrollXY();
	 document.getElementById('shadowDiv').style.height = CurrentWinScroll.winScrollY+CurrentWinSize.winHeight+"px";
	 document.getElementById('shadowDiv').style.width = CurrentWinScroll.winScrollX+CurrentWinSize.winWidth+"px";
     mousePos = mouseCoords(ev);  
}

function mouseUp(){
	if(document.getElementById('SearchResults').style.display != "none"){
		document.getElementById('SearchResults').style.display = "none";
	}
	
	Drag=false;
	clearInterval(DragIntervalID);
}
/*
function mouseDown(){
	// do nothing
}
*/

function mouseCoords(ev){   
     if(ev.pageX || ev.pageY){   
         return {x:ev.pageX, y:ev.pageY};   
     }   
     return {   
         x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,   
         y:ev.clientY + document.body.scrollTop  - document.body.clientTop   
     };   
} 

function startDrag(id){
	dx = (mousePos.x-document.getElementById(id).offsetLeft);
	dy = (mousePos.y-document.getElementById(id).offsetTop);
	if(Drag==true){
		clearInterval(DragIntervalID);
		Drag=false;
	} else {
		Drag=true;
		DragIntervalID = setInterval('syncPosition(\''+id+'\',\''+dx+'\',\''+dy+'\')',1);
	}
}

function stopDrag(id){
	Drag=false;
	clearInterval(DragIntervalID);
}

function syncPosition(id,dx,dy){
	document.getElementById(id).style.position = 'absolute';
	document.getElementById(id).style.top = mousePos.y-dy+'px';
	document.getElementById(id).style.left = mousePos.x-dx+'px';
	if (document.selection)
		document.selection.empty();
	else if (window.getSelection)
		window.getSelection().removeAllRanges();
}

// shadow ------------------------------------------------------------------------------------------------------------------

	
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

	var shodowState= false;
 	var IntervalID;
	function shadow(maxShadow,layerName){
		changeOpac(0, 'shadowDiv')
		document.getElementById('shadowDiv').style.display = 'inline';
	    opacity('shadowDiv', 0, maxShadow, 500);
		setTimeout("document.getElementById('"+layerName+"').style.display = 'inline';",500);
		globalIntervalID = setInterval('shadowHi()',1);
	}
	globalHeightMax = 0;
	function shadowHi(){
		CurrentWin = alertSize();
		CurrentWinscr = getScrollXY();
		currentHeight = CurrentWin.pageHeightS+CurrentWinscr.winScrollY;
		if(globalHeightMax<currentHeight){
			globalHeightMax = currentHeight;
			document.getElementById('shadowDiv').style.height = globalHeightMax+"px";
		}
	}
	
	function shadowOff(maxShadow){
		clearInterval(globalIntervalID);
		opacity('shadowDiv', maxShadow, 0, 500);
		setTimeout("document.getElementById('shadowDiv').style.display = 'none'",500);
	}
//
// feed back ---------------------------------------------------------------------------------------------------------------

function FeedBack(){
		CurrentWinScroll = getPageSizeWithScroll();
		document.getElementById('FeedBackDiv').style.top = 180+"px";
		document.getElementById('FeedBackDiv').style.left = 0+"px";
		changeOpac(0, 'FeedBackDiv');
		document.getElementById('FeedBackDiv').style.display = 'inline';
	    opacity('FeedBackDiv', 0, 100, 500);
}

function viewInfo(id,w,h){
			infoPosition(event);
			document.getElementById('Information').style.display = 'inline';
			document.getElementById('Information').style.zIndex = 20;
			document.getElementById('Information').innerHTML = "<table width='160' height='30' border='0' cellspacing='0' cellpadding='0'><tr><td width='1'>&nbsp;</td><td width='"+w+"' style='padding:5x; border:1px solid #CCCCCC; background:#FFFFFF'>"+document.getElementById(id).innerHTML+"</td><td width='1'>&nbsp;</td></tr></table>";
}

function infoPosition(ev){
		var ev = ev || window.event;
		info = mouseCoords(ev);
		Position('Information',info.x+10,info.y+20);	
}

function removeInfo(){
		document.getElementById('Information').style.display = 'none';			
}

function errorHandel(err){
	message="There was an error on this page.\n";
	if(err.description="Object requierd"){
		message+="Error description: unknown DHTML Object\n";
	} else {
		message+="Error description: " + err.description + "\n";
	}
	message+="Click OK to continue.\n";
	return message;
}


function viewGallery(){
	document.getElementById('Gallery').innerHTML = document.getElementById('Gallery_fake').innerHTML;
	shadow( 80, 'Gallery');	
}

//---------------------------------------------------------
	function formSubmit(){
		if(document.getElementById('name').value==""){
			alert("????? ??? ??? ?? ???? ????");
		} else if(document.getElementById('email').value==""){
			alert("???? ????? ??? ?? ???? ????");
		} else if(document.getElementById('subject').value==""){
			alert("???? ????? ??? ?? ???? ????");
		} else if(document.getElementById('message').value==""){
			alert("???? ??? ????? ??? ?? ???? ????");
		} else if(document.getElementById('mysecnum').value==""){
			alert("????? ?? ?????? ?? ???? ????");
		} else {
			document.form1.action = 'http://test.ictn.ir/hesk/submit_ticket.php';
			document.form1.submit();
		}
	}
	
	function submitIdea(){
		if(document.getElementById('name').value==""){
			alert("????? ??? ??? ?? ???? ????");
		} else if(document.getElementById('email').value==""){
			alert("???? ????? ??? ?? ???? ????");
		} else if(document.getElementById('message').value==""){
			alert("???? ??? ????? ??? ?? ???? ????");
		} else {
			show('des');
			hide('FormDiv');
			updateData('common/sendMail.php','POST','des','form_titel=??? ?????? ?? ??&name='+document.getElementById('name').value+'&email='+document.getElementById('email').value+'&message='+document.getElementById('message').value);
		}
	}
	
	function submitNewsLetter(ChekBoxNum){
		hide('newsLetterForm');
		hide('NewsLetterSubmit');
		document.getElementById('NewsLetterState').innerHTML = document.getElementById('tab_loading').innerHTML;
		value="";
		for(i=1;i<=ChekBoxNum;i++)
			if(document.getElementById('checkbox'+i).checked)
				value += ","+i;
		iFrameLocation('loader',"scripts/submitNewsLetter.php?info="+value+"&email="+document.getElementById('emailField').value+"&rand="+rand);
	}
	
	function enterEmail(){
		if(document.getElementById('emailField').value!='Example@website.com'){
			if(emailValid(document.getElementById('emailField'))){
				shadow(70,'newsLetter');
				document.getElementById('emailSpan').innerHTML=document.getElementById('emailField').value; 
				show('newsLetterForm'); 
				show('NewsLetterSubmit'); 
				DivInnerHTML('NewsLetterState','');
			}
		} else { 
			alert('???? ???? ????? ??? ?? ???? ??????'); 
		}
	}

function moreInfo(){
	alert("More information retrivement failed!");	
}

function pausecomp(millis) {
	var date = new Date();
	var curDate = null;
	do { 
	curDate = new Date(); 
	} while(curDate-date < millis);
} 


var imageNum=2;
var imageLink= Array("main/newsView.php?id=85","cyberoam/","security/","symantec/");
function flashReplace(id){
	/*DivInnerHTML(id,'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td style="padding-bottom:1px" align="right" dir="rtl" height="25" bgcolor="#323232"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><font face="tahoma" size="1" color="#FFFFFF">&nbsp;&nbsp;&#1604;&#1591;&#1601;&#1575;&#1611;&#32;&#1576;&#1585;&#1575;&#1740;&#32;&#1606;&#1605;&#1575;&#1740;&#1588;&#32;&#1705;&#1575;&#1605;&#1604;&#32;&#1608;&#1576;&#32;&#1587;&#1575;&#1740;&#1578;&#32;&#70;&#108;&#97;&#115;&#104;&#32;&#80;&#108;&#97;&#121;&#101;&#114;&#32;&#56;&#32;&#1608;&#32;&#1740;&#1575;&#32;&#1606;&#1587;&#1582;&#1607;&#32;&#1576;&#1575;&#1604;&#1575;&#1578;&#1585;&#32;&#1585;&#1575;&#32;&#1606;&#1589;&#1576;&#32;&#1705;&#1606;&#1740;&#1583;&#46;</font></td><td align="left">&nbsp;&nbsp;<a href="http://get.adobe.com/flashplayer/" target="_blank"><img src="index_files/flashPlayerInstall.gif" border="0" /></a>&nbsp;</td></tr></table></td></tr><tr><td height="280" id="imagePlace">&nbsp;</td></tr></table>');*/
	DivInnerHTML(id,'<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="280" id="imagePlace">&nbsp;</td></tr></table>');
	DivInnerHTML('imagePlace','<a href="'+imageLink[0]+'"><img src="index_files/swf_Files/01_swf.jpg" border="0" /></a>');
	setInterval(switchImage,10000);
}

function switchImage(){
	DivInnerHTML('imagePlace','<a href="'+imageLink[imageNum-1]+'"><img src="index_files/swf_Files/0'+imageNum+'_swf.jpg" border="0" /></a>');
	if(imageNum<4)
		imageNum++;
	else
		imageNum=1;
}

function switchDisplay(id){
		if(document.getElementById(id).style.display == 'none')
			show(id);
		else
			hide(id);
}