function onNavi(obj) {
	document.getElementById(obj).style.visibility = 'visible';
	document.getElementById('navi-wrapper').style.visibility = 'visible';
}

function outNavi(obj) {
	document.getElementById(obj).style.visibility = 'hidden';
	document.getElementById('navi-wrapper').style.visibility = 'hidden';
}

function onNavia(obj) {
	document.getElementById(obj).style.visibility = 'visible';
}

function outNavia(obj) {
	document.getElementById(obj).style.visibility = 'hidden';
}

function changeTxt(txt) {
	document.getElementById('map-zoom').innerHTML = txt;
}

function changeMap(img) {
	document.getElementById('map').src = 'images/main-col/' + img + '.gif';
}

function popup(pid, width, height) {
	window.open('popup.php?pid='+ pid, 'new', 'width=' + width + ',height=' + height + '');
}

function validform(){
	var errors = "";

	var VEmail = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-_+";

	var Name = document.forms[0].elements[0].value;

	var Email = document.forms[0].elements[1].value;

	var Subject = document.forms[0].elements[2].value;
	
	if (!Name) {
		errors += "-Please write your name\n";
	}
	
	if (!Email) {
		errors += "-Please write email address\n";
	} else {

		for (var i=0; i<Email.length; i++) {
	
			var chk = Email.charAt(i)
	
			if (VEmail.indexOf(chk) == -1) {
	
				alert("-Please write correct email address\n");
	
				document.forms[0].elements[1].focus();
	
				//document.forms[0].elements[1].select();
	
				return false;
	
			}
	
		}
	
		if (Email.indexOf("@") == -1) {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	
		if (Email.charAt(0) == "@") {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	
		if (Email.indexOf(".") == -1) {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	
		var e = Email.split("@");
	
		if (e[1].indexOf(".") == -1) {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	
		if (e[1].charAt(0) == ".") {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	
		if (Email.indexOf(" ") != -1) {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	
		
	
		var period=Email.indexOf(".");
	
		if (period == Email.length -1) {
	
			alert("-Please write correct email address\n");
	
			document.forms[0].elements[1].focus();
	
			//document.forms[0].elements[1].select();
	
			return false;
	
		}
	}
	
	if (!Subject) {
		errors += "-Please write subject\n";
	}
	
	if (errors == "") {
		return true;
	} else {
		alert(errors);
		return false;
	}
}

function showTxt(id) {
  document.getElementById(id).style.display = 'block';
}

function hideTxt(id) {
  document.getElementById(id).style.display = 'none';
}

function checkbox(cid) {
	window.location.replace('query.inc.php?cb&cid=' + cid);
	document.check.submit();
}

function chooseFormat(modID,bID) {
	//window.location.replace('index.php?module=' + modID + '&box=' + bID);
	document.format.submit();
}

function chooseMainCat() {
	document.maincat.submit();
}

function chooseHCat() {
	document.hcat.submit();
}

function chooseHCat2() {
	document.hcat2.submit();
}

function chooseHCat3() {
	document.hcat3.submit();
}

function chooseSubCat() {
	document.subcat.submit();
}

function chooseNumPg() {
	document.numpg.submit();
}

function flash1() {
document.write('<object type="application/x-oleobject"');
document.write(' classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write(' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"');
document.write('<param name="movie" value="nike01.swf">');
document.write('<param name="play" value="true">');
document.write('<param name="loop" value="true">');
document.write('<param name="quality" value="high">');
document.write('<embed src="nike01.swf"');
document.write(' type="application/x-shockwave-flash"');
document.write(' pluginspage="http://www.macromedia.com/go/getflashplayer"');
document.write(' width="732"');
document.write(' height="311"');
document.write(' play="true"');
document.write(' loop="true"');
document.write(' quality="high">');
document.write('<'+'/embed>');
document.write('<'+'/object>');
}

function chooseMSelect() {
	document.main.submit();
}

function chooseSSelect() {
	document.sub1.submit();
}

function chooseSSelect2() {
	document.sub2.submit();
}

function chooseSSelect3() {
	document.sub3.submit();
}