	/* testing purpose for checkin and check out for general 
 * To show error message box
 */
 
 var commentsArray;
 function displayErrorMessages(msg){
 	var err_div  = document.getElementById('error_message');		
  	err_div.style.display = 'block';
	err_div.innerHTML = msg ;
  }


 function clearErrorMessages(){
 	var err_div  = document.getElementById('error_message');		
  	err_div.style.display = 'none';
	err_div.innerHTML = '' ;
 }
  
  function isComboSelected(elem, helperMsg){
	if(elem.value == 0){
		displayErrorMessages(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
	}
	return true;
}

/* 
 * The function will write the album url in a textarea of left menu panel
*/
function generateAlbumUrl(message) {
	document.getElementById('albumurl').value = message;
}

/* 
 * The function performs the visibility of a div in a left menu panel
*/
function doVisibility(show) {
	if(show == "1")
		document.getElementById('generateAlbumUrl').style.display = 'block';
	else 
		document.getElementById('generateAlbumUrl').style.display = 'none';	
}

/*
 * To check the field is empy 
 */

 function isEmpty(elem, helperMsg){
	elem.value=trim(elem.value)
	if(elem.value.length == 0){
		displayErrorMessages(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
  	}
	return true;
 }

/* Function to hide shown errors messages*/

 function hideErrorMessages(){
 	document.getElementById('error_message').style.display = "none";
 }

 
/*
 * To check the field value is numeric
 */

 function isNumeric(elem, helperMsg){
	var numericExpression = /^[0-9]+$/;
	if(elem.value.match(numericExpression)){
		return true;
 	}else{
		
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}

/*
 * To check the field value is alphabet
 */
function isAlphabet(elem, helperMsg){
	var alphaExp = /^[a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	 }else{
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}




/*
 * To check the field value is alphabet
 */
function isAlphabetWithSpace(elem, helperMsg){
	//var alphaExp = /^[a-zA-Z  + -]+$/;
	//var alphaExp = /^[a-zA-Z\s-]+$/;
	var alphaExp = /^\D+$/;
	if(elem.value.match(alphaExp)){
		return true;
	 }else{
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}


/*
 * To check the feild is alphanumeric
 */

function isAlphanumeric(elem, helperMsg){
	var alphaExp = /^[0-9a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	 }else{ 
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}

/*
 * To check feild length
 */
/*
 * To check feild length
 */

function lengthRestriction(elem, min, max,helperMsg){

	var uInput = elem.value;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	 }else{
	
		displayErrorMessages(helperMsg);
	
		elem.focus();
		return false;	
	}
}
/*
function lengthRestriction(elem, min, max){

	var uInput = elem.value;
	if(uInput.length >= min && uInput.length <= max){
		return true;
	 }else{
	
		displayErrorMessages(" " +min+ "  " +max+ " ");
	
		elem.focus();
		return false;	
	}
}
*/
/*
 * To check that the field is selected
 */

function madeSelection(elem, helperMsg){
	if(elem.value == "Please Choose"){
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}else{	
		return true;
	}
}

/*
 * To validate email address
 */

function emailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;	
	var email = trim(elem.value);
	if(email.match(emailExp)){	
		return true;
	 }else{
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}

/*
 * To check wether the two fields are equal or not
 */

function isEqual(elem1, elem2, helperMsg){	
	if(elem1.value === elem2.value){
		return true;
	}else{
		displayErrorMessages(helperMsg);
		elem1.focus();
		return false;
	}
}

 /*
 * radio button checked or not 
 */

 function radioChecked(elem,helperMsg) {
 	var radio_choice = false;
 	for(counter=0;counter<elem.length;counter++){
 		if(elem[counter].checked){
	 		radio_choice = true;
	 	}	 	
 	}
 	if(radio_choice) 	{
 		return true;
 	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
 	
 }

 /*
 * Checkbox checked or not 
 */
 function checkboxChecked(elem,helperMsg) {
 	if(elem.checked){
 		return true;
 	}else{
 		displayErrorMessages(helperMsg);
		return false;
 	}
 }

 
 /*
 * Date of Birth validation 
 */

 function checkDOB(day,month,year,helperMsg)  {
 	var checkFlag = false;
 	var mydate= new Date();
 	var theYear = mydate.getUTCFullYear();
 	var thetoday = mydate.getUTCDate();
 	var theMonth = mydate.getUTCMonth()+ 1;
 	if( ( (month.value==4) || (month.value==6) || (month.value==9) || (month.value==11) ) && ( day.value > 30 ) ) {
  		checkFlag = true ;
  	}
  	if(month.value == 2) {
  		if((year.value%4) == 0)	{
  			if(day.value > 29)	{
  				checkFlag = true ;
  			}
  		}else{
  			if(day.value > 28)	{
  				checkFlag = true ;
  			}
  		}   	
 	}
 	if( (year.value == theYear) && ((month.value > theMonth)|| ((month.value >= theMonth)&& (day.value > thetoday) ) ))
 	{
 		checkFlag = true ;
 	}
    if(checkFlag){
  		displayErrorMessages(helperMsg);
  	}
  return checkFlag ;
 }
  
function isValidDateFormat(elem,helperMsg) {
	var dPat = /^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/;
	if(elem.value.match(dPat)){
		return true;
	 }else{
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}

function isValidDate(elem,helperMsg)  { 	
 	var checkFlag = false;
 	var dateArray = elem.value.split("-");
	var	year = dateArray[0];
	var	month = dateArray[1];
	var	day = dateArray[2];
  	if(month>12){
  		checkFlag = true ;
  	}  	
	if((year < 1900) || (month == 0) || (day == 0) ){
  		checkFlag = true ;
  	}
  	if(month == 2) {
  		if((year%4) == 0)	{
  			if(day > 29)	{
  				checkFlag = true ;
  			}
  		}else{
  			if(day > 28)	{
  				checkFlag = true ;
  			}
  		} 		
   	}
	else if( ( (month==4) || (month==6) || (month==9) || (month==11) ) && ( day > 30 ) ) {
  		checkFlag = true ;
  	}
	else if( ( (month==1) || (month==3) || (month==5) || (month==7) || (month==8) || (month==10)  || (month==12)) && ( day > 31 ) ) {
  		checkFlag = true ;
  	}

  	if(checkFlag){
  		displayErrorMessages(helperMsg);
  	}
	return checkFlag ;
 }
 	
function isFutureDate(elem, helperMsg){
	var curDate=new Date();
	var myDate=new Date();
	var dateArray = elem.value.split("-");
	var	year = dateArray[0];
	var	month = dateArray[1];
	var	day = dateArray[2];
	var month = month - 1;
	myDate.setFullYear( year, month, day );
	if (myDate > curDate){
		displayErrorMessages(helperMsg);
		elem.focus();
		return true;
	 }else{		
		return false;
	}
}
	

 

  /*
 * To validate Postal code
 */

function isValidPostalCode(elem, helperMsg){


	var numericExp = /^[0-9]{6}$/;
	
	
	if(elem.value.match(numericExp)){
	
		return true;
	 }else{ 
	
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	 
	}
}


 /*
 * To validate Dob yyyy/mm/dd
 */

function isValidDob(elem, helperMsg){


	var dobExp = /^\d{4}\-\d{1,2}\-\d{1,2}$/;;
	
	
	if(elem.value.match(dobExp)){
	
		return true;
	 }else{ 
	
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	 
	}
}


/*
 * To validate feild length 
 */

function validateLength(elem, max, hleperMsg){

	var uInput = elem.value;
	
	if(uInput.length <= max){
	
		return true;
	 }else{
	
		displayErrorMessages(hleperMsg);
		elem.focus();
		return false;
	
	}
}

/*
 * To check the feild is alphanumeric with underscore
 */

function isAlphanumericspace(elem, helperMsg){

	var alphaExp = /^[0-9a-zA-Z_]+$/;
	
	if(elem.value.match(alphaExp)){
	
		return true;
	 }else{ 
	
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	 
	}
}


/*
 * To check wether the two fields are equal or not
 */

function isIdentical(elem1, elem2, helperMsg){	

	
	if(elem1.value === elem2.value){
	
		displayErrorMessages(helperMsg);
		elem1.focus();
		return true;
	
	}else{
	
		return false;
	
	}
}


/* 
 * Validate the image types for upload 
 */
 
function imageValidate(fldName, errorMsg) {
	if (!/(\.(gif|jpg|jpeg|bmp|png|tiff|tif))$/i.test(fldName.value)) {
		displayErrorMessages(errorMsg);
		fldName.focus();
		return false;
	}
	return true;
}



/* 
 * Validate the date format for dob
 */

function isValidDobFormat(fld, helperMsg) {
var dateStr = fld.value;
var datePat = /^\2(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/;

if((dateStr.charAt(4) != "-") || (dateStr.charAt(7) != "-")){
	displayErrorMessages(helperMsg);
	return false;
}

var matchArray = dateStr.split('-');
month = matchArray[1];
day = matchArray[2];
year = matchArray[0];

if(month < 1 || month > 12) {
	displayErrorMessages(helperMsg);
	return false;
}

if (day < 1 || day > 31){
	displayErrorMessages(helperMsg);
	return false;
}
if ((month==4 || month==6 || month==9 || month==11) && day==31){
	displayErrorMessages(helperMsg);
	return false
}
if (month == 2) {
	var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if ((day>29) || (day==29 && !isleap)) {
			displayErrorMessages(helperMsg);
			return false;
		}
}
return true;
}


function validatePhnum(phnum,helperMsg){
	var dPat = /^(\d{2}-\d{4}-\d{4})$/;
	if(phnum.value.match(dPat)){
		return true;	
	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
	return false;
}

function validatefaxnum(phnum,helperMsg){
	var dPat = /^(\d{2}-\d{4}-\d{4})$/;
	if(phnum.value != "")
	{
		if(phnum.value.match(dPat)){
			return true;	
		}else{
			displayErrorMessages(helperMsg);
			return false;
		}
	}
	else
	{
		return true;
	}
	//return false;
}

function validatePhonenum(phnum,helperMsg){
	var phValue = phnum.value;

	if(phValue != "") {
	if(phValue.charAt(0) != 0) {
		displayErrorMessages(helperMsg);
		phnum.focus();
		return false;
	} else {
		if(phValue.length < 10) {
			displayErrorMessages(helperMsg);
			phnum.focus();
			return false;
		} else {
			var isNum = isNumeric(phnum, helperMsg);
			if(!isNum) {
				phnum.focus();
				return false;
			} else {
				return true;
			}
		}
	}
	} else {
		return true;
	}
}

/*function validatePostal(phnum,helperMsg){
	var dPat = /^(\d{3}-\d{4})$/;
	if(phnum.value.match(dPat)){
		return true;	
	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
	return false;
}*/
function validatePostal1(phnum,helperMsg){
	var dPat = /^(\d{3})$/;
	if(phnum.value.match(dPat)){
		return true;	
	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
	return false;
}
function validatePostal2(phnum,helperMsg){
	var dPat = /^(\d{4})$/;
	if(phnum.value.match(dPat)){
		return true;	
	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
	return false;
}

/*
 * To check wether the two fields are equal or not case insensitive
 */
function isiIdentical(elem1, elem2, helperMsg){	

	
	if(elem1.value.toLowerCase() === elem2.value.toLowerCase()){
	
		displayErrorMessages(helperMsg);
		elem1.focus();
		return true;
	
	}else{
	
		return false;
	
	}
}

function validateCity(elem,helperMsg)
{
	if(elem.value.length > 0)
	{
		/*  MILESTONE 4, Bug id 4244 , Manju Padmanabhan , 09-oct-07, START  */
		//var alphaExp = /^[a-zA-Z\s-]+$/;
		var alphaExp = /^\D+$/;
		/*  MILESTONE 4, Bug id 4244 , Manju Padmanabhan , 09-oct-07, END  */
		if(elem.value.match(alphaExp)){
			return true;
		 }else{
			displayErrorMessages(helperMsg);
			elem.focus();
			return false;
		}
	}
	else
	{
		return true;
	}
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
function ltrim(stringToTrim) {
	return stringToTrim.replace(/^\s+/,"");
}
function rtrim(stringToTrim) {
	return stringToTrim.replace(/\s+$/,"");
}

function validatePrice(elem,helperMsg){
	var dPat =/^((0|[1-9]\d*)|(0|[1-9]\d*)(\.\d{1,2}))$/ ; 
	if(elem.value.match(dPat)){
		return true;	
	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
	return false;
}

function validNumber(elem,helperMsg){
	if(elem.value > 0){
		return true;	
	}else{
		displayErrorMessages(helperMsg);
		return false;
	}
}


		
function generatePdf(url)
{
            window.open(url);
}

//MILESTONE 4, unwanted parameter is removed, fixed by renga, 28-09-2007, START
function goBack()
{
           window.history.back();
}
//MILESTONE 4, unwanted parameter is removed, fixed by renga, 28-09-2007, START

/*
 * To validate loyalti price for template
 */
function validateLoyaltyPrice(obj, helperMsg)
{
	if(obj.value.length != 0)
	{
		if(! validatePrice(obj, helperMsg))
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	else
	{
		return true;
	}
}


/* function to validate the login form */
function validateSearchForm(obj){		
		
		
		if(!isSearchFieldEmpty(obj.query,"キーワード又はタグを入力してください。"))  	
  			return false;
		else
			return true;		
					
	}
function showErrorMessages(msg){
 	var err_div  = document.getElementById('error_right_message');		
  	err_div.style.display = '';
	err_div.innerHTML = msg ;
}
/*
 * To check the field is empy 
*/
function isSearchFieldEmpty(elem, helperMsg){
	elem.value=trim(elem.value)
	if(elem.value.length == 0){
	 	var err_div  = document.getElementById('search_error_message');		
	  	err_div.style.display = '';
		err_div.innerHTML = helperMsg ;
		elem.focus(); // set the focus to this input
		return false;
  	}
	return true;
}
/*
 * To check the field is empy 
*/
function isFieldEmpty(elem, helperMsg){
	elem.value=trim(elem.value)
	if(elem.value.length == 0){
		showErrorMessages(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
  	}
	return true;
}
/*
 * To check the feild is alphanumeric
 */

function isFieldAlphanumeric(elem, helperMsg){
	var alphaExp = /^[0-9a-zA-Z]+$/;
	if(elem.value.match(alphaExp)){
		return true;
	 }else{ 
		showErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}

/*
 * To validate email address
 */

function isEmailValidator(elem, helperMsg){
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;	
	var email = trim(elem.value);
	if(email.match(emailExp)){	
		return true;
	 }else{
		showErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}






function loginFormValidation(obj){
	

	if(!isFieldEmpty(obj.username, "有効なユーザーIDを入力してください。")) 
		return false;
	else if(!isFieldEmpty(obj.pwd, "パスワードを正しく入力してください。")) 
		return false;
	else if((obj.username.value.search('@')) >= 0)
	
	{
	
	
		if(!isEmailValidator(obj.username, "ログインを失敗しました。もう一度お試しください。"))
		
		{
		
		return false;
		
		}
				
	
	}
	
//	else if(!isFieldAlphanumeric(obj.username, "ログインを失敗しました。もう一度お試しください。"))
//		return false;
	else if(!isFieldAlphanumeric(obj.pwd, "ログインを失敗しました。もう一度お試しください。"))
		return false;		
      
      /* MILESTONE 6, adding Image Autheticator in Login page , laxmi , 15-oct-07, START */	
		
	//else if(!isFieldEmpty(obj.user_captcha,"以上の画像に表示されている文字を入力してください。"))

  		//return false;

	//else if(isiIdentical(obj.captcha, obj.user_captcha, "入力した文字は表示の文字と異なります。"))
            //return false;

	/* MILESTONE 6, adding Image Autheticator in Login page , laxmi , 15-oct-07, END */	
		
 	else
		return true;		
	
}



function checkValidPostalCode(shipping_postal1,shipping_postal2,shipping_nickname,address,uniqueaddress,helperMsg,helperMsg1){
	xmlHttp = GetXmlHttpObject();
	xmlHttp1 = GetXmlHttpObject();
 	//postcode = shipping_postal.value ; 
    postcode = shipping_postal1.value+shipping_postal2.value ; 
 	var nickname = shipping_nickname.value ; 
 	var url= address + "pcode/" + postcode ;
 	xmlHttp.open("GET",url,false);
	xmlHttp.send(null);
	
		var response = xmlHttp.responseText;
		var splitResult = response.split("-delimiter-");
		if( (splitResult[1] == "" ) &&  (splitResult[2] == "" ) && (splitResult[3] == "" ) && (splitResult[4] == "" ) )
		{
			displayErrorMessages(helperMsg);
			chkPostal = 0;
			return false;						
		}
		else
		{
			checkValidNickName(shipping_nickname,uniqueaddress,helperMsg1);
		}	
 }




function dateValidation(dateStr,helperMsg) {
	var datePat = /^\2(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/;
	var i=7;
	if(dateStr.length == 9){
		
		i=6;
	
	}
	if((dateStr.charAt(4) != "-") || (dateStr.charAt(i) != "-")){
		
		displayErrorMessages(helperMsg);
		return false;
		
	}
	
	//var matchArray = dateStr.match(datePat); // is the format ok?
	var matchArray = dateStr.split('-');
	//alert(matchArray);
		
	month = matchArray[1];
	day = matchArray[2];
	year = matchArray[0];
	//alert(year);
	//alert(month);
	//alert(day);

	if (month < 1 || month > 12) { // check month range

	displayErrorMessages(helperMsg);
	return false;

	}
	if (day < 1 || day > 31) {

	displayErrorMessages(helperMsg);
	return false;

	}
	if ((month==4 || month==6 || month==9 || month==11) && day==31) {

	displayErrorMessages(helperMsg);
	return false

	}
	if (month == 2) { // check for february 29th

	var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
	
		if (day>29 || (day==29 && !isleap)) {
	
	displayErrorMessages(helperMsg);
	return false;
	
	   }
	}

	return true;  // date is valid

	}



 function checkdiffDate(date1,date2,helperMsg){
 
 	var check = false;
  	var replacedateformat1 = date1.replace(/-/g,"/");
 	var replacedateformat2 = date2.replace(/-/g,"/");
 	var dateparsevalue1 = Date.parse(replacedateformat1);
 	var dateparsevalue2 = Date.parse(replacedateformat2);
 	
 	if(dateparsevalue2 >= dateparsevalue1){
 	
 	 		check = true;
 	
 	}
 	
 	
 	
 	if(check == false){
 	
  		displayErrorMessages(helperMsg);
  	
  	}
  	
	return check; 	

 }


function futuredateValidation(elem, helperMsg){
	var curDate=new Date();
	var myDate=new Date();
	var dateArray = elem.split("-");
	var	year = dateArray[0];
	var	month = dateArray[1];
	var	day = dateArray[2];
	var month = month - 1;
	myDate.setFullYear( year, month, day );
	if (myDate > curDate){
		displayErrorMessages(helperMsg);
		return false;
	 }else{		
		return true;
	}
} 



function isFloat(elem, helperMsg){
	var numericExpression = /^((\d+(\.\d*)?)|((\d*\.)?\d+))$/;
	if(elem.value.match(numericExpression)){
		return true;
	} else {
		displayErrorMessages(helperMsg);
		elem.focus();
		return false;
	}
}




function checkGreater(val1,val2,helperMsg){

	 var check = false;

	 if(parseFloat(val1.length)!=0 && parseFloat(val2.length)!=0)
			check=false;
		if(parseFloat(val1) <= parseFloat(val2)){

			return true;

	 	}

 	

 		if(check == false) {

  			displayErrorMessages(helperMsg);return false;

	  	}



}


function checkValidNickName(shipping_nickname,address,helperMsg){
	xmlHttp = GetXmlHttpObject();
 	var nickname = shipping_nickname.value ; 
 	var url= address + "shippingNickName/" + nickname ;
 	xmlHttp.open("GET",url,false);
	xmlHttp.send(null);
	
		var response = xmlHttp.responseText;
		if(response == 1)
		{
			displayErrorMessages(helperMsg);
			return false;						
		}
		else
		{
			chkPostal=1;
			return true;
		}	
 }

function scrollToTop(){

	scrollTo(0, 0);

}




 function displayErrorMessagesById(msg, id){
 	var err_div  = document.getElementById(id);		
  	err_div.style.display = 'block';
	err_div.innerHTML = msg ;
  }
  
   function hideErrorMessagesById(id){
 	document.getElementById(id).style.display = "none";
 }
 
 
 
 	function validQuantity(elem, divid, isNumberMsg, validNumberMsg, maxQtyLimitMsg)
 	{
		var numericExpression = /^[0-9]+$/;
		if(!(elem.value.match(numericExpression))){
			displayErrorMessagesById(isNumberMsg, divid);
			elem.focus();
			return false;
		}
	 	if(!(parseInt(elem.value) > 0)){
				displayErrorMessagesById(validNumberMsg, divid);
				elem.focus();
				return false;
		}
		if (parseInt(elem.value) > maxQuantityLimit )
		{
			displayErrorMessagesById(maxQtyLimitMsg, divid);
			elem.focus();
			return false;
		}
		return true;
	}



function closeCartItem(slideid, imgid, hidid)
{
	var imgSrc = document.getElementById(imgid).src;
	if (document.getElementById(hidid).value == 0)
	{ 	
			slideid.start();
			//document.getElementById(cartid).style.display = 'none';
			document.getElementById(hidid).value = 1;
			imgSrc = imgSrc.replace('minus','plus');
	}		
	else
	{
			slideid.start();
			document.getElementById(hidid).value = 0;
			//document.getElementById(cartid).style.display = '';
			imgSrc = imgSrc.replace('plus','minus');
	}
	document.getElementById(imgid).src = imgSrc; 
}


/*
 * To check wether the element contains whitespace or not
 */
function hasWhiteSpace(elem1, helperMsg){	
	var alphaExp = /(\s)/ ;
	if(elem1.value.match(alphaExp)){
		displayErrorMessages(helperMsg);
		elem1.focus();
		return true;
	}
	else
	{  
		return false;
	}
}

 /*
 * To check wether the element is null or not
 */
 function isNull(elem, helperMsg){
	if(elem.value.length == 0){
		displayErrorMessages(helperMsg);
		elem.focus(); // set the focus to this input
		return false;
  	}
	return true;
 }
 
 function confirmUnregister()
 {
 	
 	var status = confirm ("登録を取り消ししますか？｛まっしょう｝");
 	
    if (status==false)
        	return false
    else
    		return true;    	
 
 }

function loadUrl()
{
	var photoprintForm = document.getElementById('myPhotoprintform');
	photoprintForm.submit();
	hm('uploadPhotoprint');
} 

function redirectUrl(formName, submitAction)
{
	document.getElementById(formName).action = submitAction;
	document.getElementById(formName).submit();
}

function turnOnOff(id, imgName, imgPath)
{ 
	id.src = imgPath+imgName;
}

function displayComments(albumId,isalbumImage,appHeight){
	//commentsArray = new Spry.Data.XMLDataSet("http://localhost/plazacreateweb/wops/album/Comments/displayAlbumcomments/albumimageId/"+ albumId + "/isalbumimage/" + isalbumImage, "/pending/comnts",{useCache:false});
	commentsArray.setURL(baseUrl+"/album/Comments/displayAlbumcomments/albumimageId/" + albumId + "/isalbumimage/"+ isalbumImage);
	commentsArray.loadData();
	document.getElementById('comments').style.display = '';
	document.getElementById('displayAlbum').style.height = appHeight;
}

function unhideComments(){
	document.getElementById('comments').style.display = '';
}
function hideComments(){
	document.getElementById('comments').style.display = 'none';
}
	// Flash Player Version Detection - Rev 1.5
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.


var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;			
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
			var versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		for (var i in params)
  			str += '><param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '></object>';
    } else {

  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, "", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "id":
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  ret.objAttrs["codebase"] = 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab';
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


	
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
// -----------------------------------------------------------------------------
// -->


// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);


// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasRequestedVersion ) {
	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
	// DO NOT MODIFY THE FOLLOWING FOUR LINES
	// Location visited after installation is complete if installation is required
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;
	 AC_FL_RunContent(
		"src", "/plazacreateweb/wops/flex/installer/playerProductInstall.swf",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
		"width", "530",
		"height", "930",
		"align", "middle",
		"id", "testFFF",
		"quality", "high",
		"bgcolor", "#869ca7",
		"name", "testFFF",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);

} else if (hasRequestedVersion) {	 
	// Already Installed

  } else {  // flash is too old or we can't detect the plugin
	AC_FL_RunContent(
			"src", "/plazacreateweb/wops/flex/installer/playerProductInstall.swf",
			"width","530",
			"height","930",
			"align", "middle",
			"id", "testFFF",
			"quality", "high",
			"bgcolor", "#ffffff",
			"name", "album",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
  }