// JavaScript Document
function curdate(){
	var date=new Date();
	var year=date.getYear();
	var month=date.getMonth();
	var day=date.getDate();
	var months=new Array("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC");
	var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		
	var monthname=months[month];		
	var fulldate=weekday[date.getDay()]+", "+monthname+" "+day+", "+year;
	document.write(fulldate);				
}		
		
function runningClock(){
	var title="The Wedding Magazine of Cambodia";
	var date=new Date();
	var year=date.getYear();
	var month=date.getMonth();
	var day=date.getDate();
	var hour=date.getHours();
	var minute=date.getMinutes();
	var second=date.getSeconds();
	var months=new Array("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC")

	var monthname=months[month];

	if (hour > 12) {
		hour=hour- 12;
	}

	if (minute < 10) {
		minute="0"+minute;
	}

	if (second < 10) {
		second="0"+second;
	}

	document.title=title+" - "+monthname+" "+day+", "+year+" - "+hour+":"+minute+":"+second;
	setTimeout("runningClock()", 1000);				
}	

function searchgoogle(contentsearch)
{		
	var strSearch=document.forms[0].elements[contentsearch].value;
	if(strSearch!="")
	{			
		var googlepath="http://www.google.com/search?q="+strSearch;
		window.open(googlepath);
	}
}

function topManuClickToIndexPage(strurl)
{				
	window.location.replace = strurl;      	
}

// Disappear text in textbox when keyDown
function DisappeartextOnMouseDown(txbDayYear, txbName)
{
	var txbValue=document.forms[0].elements[txbDayYear].value;
	if(txbValue!="")
	{
		if(txbName=="dobday")
		{
			if(txbValue=="dd")
			{
				document.forms[0].elements[txbDayYear].value="";
			}			
		}
		else
		{
			if(txbValue=="yyyy")
			{
				document.forms[0].elements[txbDayYear].value="";
			}
		}
	}	
}

// Disappear text in textbox when Blur
function DisappeartextOnBlur(txbDayYear, txbName)
{
	var txbValue=document.forms[0].elements[txbDayYear].value;
	if(txbValue==""){
		if(txbName=="dobday")
		{
			document.forms[0].elements[txbDayYear].value="dd";
		}
		else
		{
			document.forms[0].elements[txbDayYear].value="yyyy";
		}
	}
	else
	{		
		if(txbName=="dobday")
		{
			if(txbValue=="dd")
			{
				document.forms[0].elements[txbDayYear].value="dd";
			}			
		}
		else
		{
			if(txbValue=="yyyy")
			{
				document.forms[0].elements[txbDayYear].value="yyyy";
			}			
		}
	}
}

// Display text in textbox
function Displaytext(txbDayYear,txbName)
{		
	var txbValue=document.forms[0].elements[txbDayYear].value;
	if(txbValue=="")
	{
		if(txbName=="dobday")
		{
			document.forms[0].elements[txbDayYear].value="dd";
		}
		else
		{
			document.forms[0].elements[txbDayYear].value="yyyy";
		}
	}	
}

// Open New Windows
function OpenNewWindows(strUrl)
{
	window.open(strUrl);
}

// Replace Windows
function OpenReplaceWindows(strUrl)
{
	window.location.href=strUrl;
}

function loaddefaultimg()
{
	var strPath="..//images//imgblank.gif";
	document.forms[0].elements[imgviewer].src=strPath;
}
<!-- Begin
function showimg()
{
	adres = document.forms[0].elements['image_file'].value;
	index = adres.indexOf(".gif");
	index = index + adres.indexOf(".jpg");
	index = index + adres.indexOf(".bmp");
	if (document.forms[0].elements['image_file'].value!="")
	{			
		var img_obj = new Image();
		img_obj = document.forms[0].elements['image_file'].value;		
		document.forms[0].elements['imgviewer'].src = img_obj;        				
  	}
}

function controlCheck(name1,name2){	
	var chk=document.forms[0].elements[name1].checked;
	if(chk){
		document.forms[0].elements[name2].checked=false;		
	}
}

function controlCheck3(name1,name2,name3){
	var rd;	
	rd=document.forms[0].elements[name1].checked;
	if(rd){
		document.forms[0].elements[name2].checked=false;
		document.forms[0].elements[name3].checked=false;		
	}
}

function Focus(Fields)
{
	document.forms[0].elements[Fields].focus();
}

function ShowComment(strid)
{		
	document.getElementById(strid).style.visibility='visible';
}

function HideComment(strid)
{	
	document.getElementById(strid).style.visibility='hidden';
}
function OpenWebMail()
{
	window.open('http://www.wedding-cambodia.com:2095/login/');
}
function displaypage(strValue){
	window.location.href="index.htm?pn="+strValue;
}
function LinkPage()
{	
	window.location.href="../security/signuppage.htm";
}
function displayhome(strValue,d){
	window.location.href="index.htm?pn="+strValue+"&id="+d;
}