// JavaScript Document

var m = new Array('moc.liamg@uremohroiretni','moc.liamg@ahtanayra','moc.liamg@ahtanayra'); 
var n = new Array('MOC.LIAMG@UREMOHROIRETNI','ahtanayrA','moc.liamg@ahtanayra'); 
function mylo(n) { 
    window.location="mailto:" + m[n].split('').reverse().join(''); 
} 

function OpenImagePopup(imgPath, title, alt) {
    var win = window.open('','preview',
    'width=50,height=50,left=0,top=0,screenX=0,screenY=0,resizable=1,scrollbar=0,status=0');
 
    var winDoc = win.document;
    if (title == undefined) title = 'My Image, Click to Close';
    if (alt   == undefined) alt   = 'My Image, Click to Close';
    var content = '<html><head><title>' + title + '</title>' +
    			  '<style>body{overflow: hidden;margin:0;}img{border:0;}</style>' +
    			  '</head><body><a href="javascript:self.close()">' +
    			  '<img alt="' + alt + '" id="image" src="' + imgPath + '" /></a></body></html>'
    win.document.write(content);
 
    winDoc.body.onload = function() {
    	var obj = winDoc.getElementById('image');
    	var w = obj.width, h = obj.height;
    	var iHeight= document.body.clientHeight, iWidth = self.innerWidth;
 
    	var left = (self.opera ? iWidth : screen.availWidth)/2 - w/2;
    	var top =  (self.opera ? iHeight : screen.availHeight)/2 - h/2;
    	win.resizeTo(w+10, h+26);
    	win.moveTo(left, top);
    }
 
    win.onload = winDoc.body.onload; // special for Mozilla
 
    // !!! Important statement: popup onload won't execute without it!
    win.document.close();
    win.focus();
}

function check_que()
{
	ret=true;
	s=document.forms['cform'].name.value;
	if(s.length<2) {
		window.alert('Υ 衯שּׂ殮 𐯫㞢Π裠 믬𐡭馠鬨 à㡨');
		ret=false;
	}
	ret=true;
	s=document.forms['cform'].tel.value;
	if(s.length<10) {
		window.alert('Υ 衯שּׂ殮 𐯫㞢ˮ볭硲欥');
		ret=false;
	}
	ret=true;
	s=document.forms['cform'].msg.value;
	if(s.length<10) {
		window.alert('Υ 衯שּׂ殮 𐯫㞢ӥ벲 򯯡殨"');
		ret=false;
	}
	return(ret);
}
function clear_cform()
{
	document.forms['cform'].tel.value='';
	document.forms['cform'].email.value='';	
	document.forms['cform'].msg.value='';
	document.forms['cform'].name.value='';
}

var sourceimg=new Array();
sourceimg[0]="/images/gal/1.jpg";
sourceimg[1]="/images/gal/2.jpg";

var Counter=0;

function changeimg()
{
var pic=document.getElementById("VMIMG");//麨ꡪᱲ鮪񡰮 id
var los = 1 + Math.floor(Math.random()* 10); //믫鸥򳣮 롰󩮮衢 롲ᬮ䣍
pic.src="/images/gal/"+los+".jpg";//檠ᥰ毠񦲳񲞍
setTimeout("changeimg()",10000);//setTimeout ⴤ氠衭 㼧㡲 change 垱 򦫳
}

function cimg()
{
var pic=document.getElementById("VMIMG");//麨ꡪᱲ鮪񡰮 id
//var los = Math.floor(Math.random() * imagesarr.length);
pic.src=sourceimg[Counter];//檠ᥰ毠񦲳񲞍
Counter++;
if(Counter > 6) Counter=0;
setTimeout("changeimg()",3000);//setTimeout ⴤ氠衭 㼧㡲 change 垱 򦫳
document.getElementById('prc1').value = Counter;
}

function rchangeimg()
{
var pic=document.getElementById("VMIMG");//麨ꡪᱲ鮪񡰮 id
rrr=Math.abs(random.nextInt()) % n;
pic.background="/images/gal/7.jpg";//檠ᥰ毠񦲳񲞍
setTimeout("rchangeimg()",2000);//setTimeout ⴤ氠衭 㼧㡲 change 垱 򦫳
}
