function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=500,height=300,left = 490,top = 277');");
}
function mask(end,middle,start,subject){
	var one ='mai';
	var two='lto:';
	var three='?Subject=';
	start,middle,end,subject;
	var putogether= one+two+start+middle+end+three+subject;
	document.location.href=eval('"'+putogether+'"');
}
function breakout_of_frame(){
  if (top.location != location) {
	top.location.href = document.location.href ;
  }
}
function faq_id(id){
	LeftPosition=(screen.width)?(screen.width-600)/2:100;
	TopPosition=(screen.height)?(screen.height-300)/2:100;
	settings='width=600,height=300,top=' + TopPosition + ',left=' + LeftPosition + ',location=no,directories=yes,menubar=yes,toolbar=yes,status=no,scrollbars=yes,resizable=yes,dependent=no';
	javascriptWindow=window.open('','Preview',settings);
	javascriptWindow.focus();
	javascriptWindow.location='/faq.php?id=' + id + '';
}
function dn_code(){ 
	window.open('/member/sbin/ryza_dn_code.php','mail','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes,width=515,height=335');
}
function reload(){
	history.go(0);
}
function CheckAll() {
	for (var i=0;i<document.messenger.elements.length;i++) {
		var e = document.messenger.elements[i];
		if ((e.name != 'allbox') && (e.type=='checkbox')) {
			e.checked = document.messenger.allbox.checked;
		}
	}
}

function ValidateOrder()
{

	var node = document.getElementsByTagName("body")[0];

	var a = [];

	var re = new RegExp('\\b' + 'invalid_input' + '\\b');

	var els = node.getElementsByTagName("*");

	var express = new RegExp("([A-Z]+[^A-Z]*)*",'g');
	for(var i=0,j=els.length; i<j; i++)

	if(re.test(els[i].className))
	{
		var OldString = els[i].title;
		// var OldString = els[i].id;
		// var NewString = OldString.replace( /([a-z])([A-Z])/, "$1 $2");
		a.push(' \n' + OldString);
	}

	return a;

}


function CartAlertError(Error)
{

	alert("Please complete the following fields: \n" + Error);

}


function CheckEmptyInput(intMarkInvalid,intMarkValid,elmToCheck)
{

	elmCheck			= document.getElementById(elmToCheck);
	var intMarkInvalid	= intMarkInvalid;
	var intMarkValid	= intMarkValid;
	
	if(elmCheck.value !== '')
	{
		if(intMarkValid == '1')
		{
			elmCheck.setAttribute('class', 'valid_input');
			elmCheck.setAttribute('className', 'valid_input');
		}
		else
		{
			elmCheck.setAttribute('class', 'reset');
			elmCheck.setAttribute('className', 'reset');
		}
	}
	else
	{
		if(intMarkInvalid == '1')
		{
			elmCheck.setAttribute('class', 'invalid_input');
			elmCheck.setAttribute('className', 'invalid_input');
		}
		else
		{
			elmCheck.setAttribute('class', 'reset');
			elmCheck.setAttribute('className', 'reset');
		}
	}
}

function validateEmail(strEmail)
{
	var expEmail	= /^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)$/i;
	return expEmail.test(strEmail);
}
