//	JavaScript Document

//	preload images
pic = new Array();
preLoadPic = new Array();
function preLoad() {
	pic[0]  = '../guest/img/tabriz-out.jpg';
	pic[1]  = '../guest/img/tabriz-over.jpg';
	pic[2]  = '../guest/img/ardebil-out.jpg';
	pic[3]  = '../guest/img/ardebil-over.jpg';
	pic[4]  = '../guest/img/hamedan-out.jpg';
	pic[5]  = '../guest/img/hamedan-over.jpg';
	pic[6]  = '../guest/img/bakhtiari-out.jpg';
	pic[7]  = '../guest/img/bakhtiari-over.jpg';
	pic[8]  = '../guest/img/kerman-out.jpg';
	pic[9]  = '../guest/img/kerman-over.jpg';
	pic[10] = '../guest/img/malayer-out.jpg';
	pic[11] = '../guest/img/malayer-over.jpg';

	for (i = 0; i < pic.length; i ++) {
		preLoadPic[i] 		= new Image();
		preLoadPic[i].src 	= pic[i];
	}
}

j = 0;
function runSlideShow() {
	var p = 5;
	var slideShowSpeed = 10000;
	var crossFadeDuration = 2;
	
	if(document.all) {
		document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
		document.images.SlideShow.filters.blendTrans.Apply();
	}
	document.images.SlideShow.src = preLoadPic[j].src;
	if(document.all) {
		document.images.SlideShow.filters.blendTrans.Play();
	}
	
	j = j + 1;
	if(j > (p - 1))
		j = 0;
	
	var t = setTimeout('runSlideShow()', slideShowSpeed);
}

//	menu mouse over
function menuOver(menuId) {
	if(document.getElementById('sub-' + menuId).style.display == 'none') {
		document.getElementById('sub-' + menuId).style.display = '';
	}
}

//	menu mouse out
function menuOut(menuId) {
	if(document.getElementById('sub-' + menuId).style.display == '') {
		document.getElementById('sub-' + menuId).style.display = 'none';
	}
}

//	change pointer
function changePointer(picId) {
	document.getElementById(picId).style.cursor = 'pointer';
}

function showHid(id) {
	for(i = 1; i<= 17; i ++) {
		document.getElementById('answer' + i).style.display = 'none';
	}
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = '';
	}
}

function makePopup(pageURL, pageName, w, h, pageScroll, pageCenter) {
	var w = parseInt(w);
	var h = parseInt(h);
	if(pageCenter == 'no')	{
		LeftPosition = 10;
		TopPosition = 10;
	} else {
		LeftPosition = (screen.width) ? (screen.width-w) / 2 : 0;
		TopPosition = (screen.height) ? (screen.height-h) / 2 : 0;
	}

	var pageConfig = 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=' + pageScroll + ', resizable=yes, width=' + (w + 18) + ', height=' + (h + 18) + ', left=' + LeftPosition + ', top=' + TopPosition;
	var popup = window.open(pageURL, pageName, pageConfig);
	popup.focus();
	return popup;
}

function picOver(obj) {
	obj.src = obj.src.replace(/out.jpg/g, 'over.jpg');
}

function picOut(obj) {
	obj.src = obj.src.replace(/over.jpg/g, 'out.jpg');
}
	
function sumOfSpecial(count) {
	var sum = 0;
	for(i = 0; i < count; i ++) {
		var text = parseInt(document.getElementById('textVirtual' + i).value);
		var price = parseInt(document.getElementById('price' + i).innerHTML);
		if(text && price) {
			sum += text * price;
		}
	}
	if(document.getElementById('sum')) { 
		document.getElementById('sum').innerHTML = sum;
		document.getElementById('sum2').value = sum;
	}
}


<!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.total_area.value == "")
  {
    alert("Please enter a value for the \"total_area\" field.");
    theForm.total_area.focus();
    return (false);
  }

  if (theForm.total_area.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"total_area\" field.");
    theForm.total_area.focus();
    return (false);
  }

  if (theForm.contact_name.value == "")
  {
    alert("Please enter a value for the \"contact_name\" field.");
    theForm.contact_name.focus();
    return (false);
  }

  if (theForm.contact_name.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"contact_name\" field.");
    theForm.contact_name.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 6)
  {
    alert("Please enter at least 6 characters in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.telephon.value == "")
  {
    alert("Please enter a value for the \"telephon\" field.");
    theForm.telephon.focus();
    return (false);
  }

  if (theForm.country.value == "")
  {
    alert("Please enter a value for the \"country\" field.");
    theForm.country.focus();
    return (false);
  }

  if (theForm.country.value.length < 2)
  {
    alert("Please enter at least 2 characters in the \"country\" field.");
    theForm.country.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan -->














var ie=navigator.appName=="Microsoft Internet Explorer" ? true : false
var rfsh_speed=60000; 

function bmouseClick(obj, lmenu){
if (obj.style.visibility == "hidden")
{
 obj.style.visibility = "visible"
 lmenu.src = "images/lo-menu.gif"
 td1.style.visibility = "visible"
}
else 
if (obj.style.visibility == "visible" || obj.style.visibility == "")
{
 obj.style.visibility = "hidden"
 lmenu.src = "images/lc-menu.gif"
 td1.style.visibility = "hidden"
}}

function check(text){
 ReturnValue=new Array;
 reg=/\w+@\w+\.\w+/g;
 ReturnValue=reg.exec(text);        
 if (ReturnValue==null)
  window.alert("Please enter a value for the \"Email\" field.");
 else
  if (ReturnValue[0]!=text)
   window.alert("Plese Enter a Correct Email !!")
  else if (ReturnValue[0]=text)
   return (true);
 return (false);
}

function setc(obj)
{
 obj.style.background="#FFFFFF";
}

function resetc(obj)
{
 obj.style.background="#F6F6F6"; 
}


//Expands and contracts the menu (if in Internet Explorer 4.0 or higher) 
 function change() { 
 	if(!document.all) 
 		return
 	if (event.srcElement.className=="expandable"){ 
 		var x=event.srcElement.parentElement 
 		if (x.all[2].style.display=="none"){ 
 			x.all[2].style.display=''; 
 			} 
 		else { 
 			x.all[2].style.display="none" 
 			} 
 		} 
 	if (event.srcElement.className=="expandable2"){ 
 		var x=event.srcElement.parentElement 
 		if (x.all[2].style.display=="none"){ 
 			x.all[2].style.display=''; 
 			} 
 		else { 
 			x.all[2].style.display="none" 
 			} 
 		} 
 	} 
 document.onclick=change


