function ValidateProductEnquiryForm (form) { // Used in Give us your feedback page (pageid=5&ctype=bm)
  var fname = form.fullname.value;   
  var city = form.city.value;
  var country = form.country.value;   
  var email = form.email.value;   

	if (!fname)	{
	  alert("You must enter your full name.");
	  return false;
	} else if (!city) {
		alert("You must enter your city.");
		return false;
	} else if (!country) {
		alert("You must select your country.");
		return false;
	} else if (!email) {
		alert("You must enter your email address.");
		return false;
	} else if ((email.indexOf('@') == -1) || (email.indexOf('.') == -1)) {
		alert("Wrong email format.");
		return false;
	} else {
		return true;
	}
}

function ValidateNewDealershipEnquiries (form) { 
  var company = form.company.value;   
  var contact_name = form.contact_name.value;   
  var city = form.city.value;
  var country = form.country.value;
  var email = form.email.value;   

  if (!company)	{
    alert("You must enter your company name.");
    return false;
	} else if (!contact_name) {
		alert("You must enter your name.");
		return false;
	} else if (!city) {
		alert("You must enter your city.");
		return false;
	} else if (!country) {
		alert("You must select your country.");
		return false;
	} else if (!email) {
		alert("You must enter your email address.");
		return false;
	} else if ((email.indexOf('@') == -1) || (email.indexOf('.') == -1)) {
		alert("Wrong email format.");
		return false;
	} else {
		return true;
	}
}

function ValidateOwnerCommentsAndSuggestions (form) { 
  var fullname = form.fullname.value;   
  var city = form.city.value;
  var country = form.country.value;
  var email = form.email.value;   

  if (!fullname)	{
    alert("You must enter your full name.");
    return false;
	} else if (!city) {
		alert("You must enter your city.");
		return false;
	} else if (!country) {
		alert("You must select your country.");
		return false;
	} else if (!email) {
		alert("You must enter your email address.");
		return false;
	} else if ((email.indexOf('@') == -1) || (email.indexOf('.') == -1)) {
		alert("Wrong email format.");
		return false;
	} else {
		return true;
	}
}

function ValidateOwnerBoatRegistration (form) { 

  var boatmodel = form.boatmodel.value;   
  var hullnumber = form.hullnumber.value;
  var fullname = form.fullname.value;
  var city = form.city.value;
  var country = form.country.value;
  var email = form.email.value;   
  var dealername = form.dealername.value;   
  var date_of_purchase = form.date_of_purchase.value;   
  
  j = form.RadioGroup1.length;
  var RadioGroup1 = "";
  for (i=0; i<j; i++){
	  if(form.RadioGroup1[i].checked) {
		  RadioGroup1 = form.RadioGroup1[i].value;
	  }
  }


  if (!boatmodel)	{
	  alert("You must enter boat model.");
	  return false;
  } else if (!hullnumber) {
	  alert("You must enter hull number.");
	  return false;
  } else if (!fullname) {
	  alert("You must enter your full name.");
	  return false;
   } else if (!city) {
		alert("You must enter your city.");
		return false;
  } else if (!country) {
	  alert("You must select your country.");
	  return false;
  } else if (!email) {
	  alert("You must enter your email address.");
	  return false;
  } else if ((email.indexOf('@') == -1) || (email.indexOf('.') == -1)) {
	  alert("Wrong email format.");
	  return false;
  } else if (!dealername) {
	  alert("You must enter dealer name.");
	  return false;
  } else if (!date_of_purchase) {
	  alert("You must enter date of purchase.");
	  return false;
  } else if (!RadioGroup1) {
	  alert("You must select one option.");
	  return false;
  } else {
	  return true;
  }
}

function ValidateMailingListRequestForm (form) { 
  var email = form.email.value;   

	if (!email) {
		alert("You must enter your email.");
		return false;
	} else if ((email.indexOf('@') == -1) || (email.indexOf('.') == -1)) {
		alert("Wrong email format.");
		return false;
	} else {
		return true;
	}
}

function currencyConverter(sefUrlStatus) {
	fileLocation = '';
	if (sefUrlStatus!='Y') {
		fileLocation = '';
	} else {
		fileLocation = '/';
	}

	w_width = 810;
	w_height = 302;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',scrollbars=yes,resizable=yes';

	fparam = fileLocation+'tools/ucc/index.php';
  window.showCurrencyConverterWindow = open(fparam, 'showCurrencyConverterWindow', theWindowParam);
	setTimeout('if(showCurrencyConverterWindow&&!showCurrencyConverterWindow.closed)showCurrencyConverterWindow.focus()',100);
}

function showMap() {
	w_width = 640;
	w_height = 400;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=no';

	fparam = 'showmap.html';
  window.showMapWindow = open(fparam, 'showMapWindow', theWindowParam);
	setTimeout('if(showMapWindow&&!showMapWindow.closed)showMapWindow.focus()',100);
}
function showContact() {
	w_width = 640;
	w_height = 400;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=no';

	fparam = 'showcontact.html';
  window.showContactWindow = open(fparam, 'showContactWindow', theWindowParam);
	setTimeout('if(showContactWindow&&!showContactWindow.closed)showContactWindow.focus()',100);
}
function printPage() {
  lochref = '' + this.location;
	if (lochref.indexOf('?') > 0) {
		lochref = '?' + lochref.substring((lochref.indexOf('?')) + 1);
	} else {
		lochref = '';
	}

	w_width = 750;
	w_height = 650;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'print.php'+lochref;
  window.showPrintWindow = open(fparam, 'showPrintWindow', theWindowParam);
	setTimeout('if(showPrintWindow&&!showPrintWindow.closed)showPrintWindow.focus()',100);
}
function emailPage() {
  lochref = '' + this.location;
	if (lochref.indexOf('?') > 0) {
		lochref = '?' + lochref.substring((lochref.indexOf('?')) + 1);
	} else {
		lochref = '';
	}

	w_width = 480;
	w_height = 335;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=no,scrollbars=no';

	fparam = 'tools/emailpage/index.php'+lochref;
  window.showEmailWindow = open(fparam, 'showEmailWindow', theWindowParam);
	setTimeout('if(showEmailWindow&&!showEmailWindow.closed)showEmailWindow.focus()',100);
}
function popupWindow (theWindow, theParam) {

//	newLeft = screen.width
//	newTop = screen.height
	switch (theWindow)
	{
		case 'newmenu':
			window.open('menuform.php?'+theParam, 'NewMenu', 'toolbar=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,width=500,height=500,left=50,top=50');
		break
		case 'editmenu':
			window.open('menuform.php?'+theParam, 'EditMenu', 'toolbar=no,status=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,width=500,height=500,left=50,top=50');
		break
		default:
			return;
	}
}
function changeLangAlert(theLang) {
	alert('The '+theLang+' language is not published yet. Please check back soon.');
}
function changeLang(theLang, theQueryString) {
  lochref = '';
	// Check if already lang parameter is sent
	if (theQueryString.match('lang=') != null) {
		langPos = theQueryString.indexOf('lang=');
		theQueryString = theQueryString.substring(0,(langPos-1))+theQueryString.substring((langPos-1)+8);
	}
	// Check all parameters that 'index.php' files handles
	if (theQueryString != '') {
		lochref = 'index.php?'+theQueryString+'&lang='+theLang;
	} else {
		lochref = 'index.php?lang='+theLang;
	}
	location = lochref;
}
function goToSearch(theform) {
  var theSearchQuery = theform.searchquery.value;
	
  lochref = 'index.php?pageaction=search&searchquery=' + theSearchQuery;
	
	location = lochref;
}
function goToSitemap() {

  lochref = 'index.php?pageaction=sitemap';

	location = lochref;
}

//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
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 = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

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

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  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 "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      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;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

/* for home flash */

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;


/* flush object */


/* functions for template ws_mm_standard_30 */
function standard_30_ChangeCountry(theId) {
	location.replace("index.php?pageid="+theId);	
}

/* functions for template ws_mm_products_34 */
function products_34_DisplaySection(theSctId) {
	
	var TotalSections = 7;
	if (theSctId == '6') { //photo gallery
	  document.getElementById("BottomSpace").style.display = "block";	
	} else {
	  document.getElementById("BottomSpace").style.display = "none";	
	}
	
	for (i=1;i<=TotalSections;i++) {
		if (i == theSctId) {
			document.getElementById("SctBlock_"+i).style.display = "block";	
			if (document.getElementById("sct"+i)) {
			  document.getElementById("sct"+i).style.fontWeight = "bold";
			  document.getElementById("sct"+i).style.color = "#575757";
			}
		} else {
			document.getElementById("SctBlock_"+i).style.display = "none";	
			if (document.getElementById("sct"+i)) {
			  document.getElementById("sct"+i).style.fontWeight = "normal";
			  document.getElementById("sct"+i).style.color = "#000000";
			}
		}
	}
}

function products_34_ChangePhotoBtnBg(theBtnId, theCase) {
  var theSelectedGalItem = document.getElementById("sel_gal").value;
  if (document.getElementById("gal"+theBtnId)) {
	if (theCase == '1') {
		document.getElementById("gal"+theBtnId).style.backgroundColor = "#C6C7C9";
	} else {
		if (theBtnId != theSelectedGalItem) {
			document.getElementById("gal"+theBtnId).style.backgroundColor = "#DFDFDF";
		}
	}
  }
}

function products_34_DisplayGallery(theGalNum, theDefPhoto, theImgW, theImgH) {
		
	var TotalGalleries = 3;
	var bigphoto = document.getElementById("BigPhoto");

	for (var i=1;i<=TotalGalleries;i++) {
		if (i == theGalNum) {
			document.getElementById("PhotoGallery_"+i).style.display = "block";	
			document.getElementById("sel_gal").value = i;
			if (document.getElementById("gal"+i)) {
			  document.getElementById("gal"+i).style.backgroundColor = "#C6C7C9";
			}
			if (document.getElementById("BigPhoto")) {
				bigphoto.innerHTML = '<img src="' + theDefPhoto + '" width="'+theImgW+'" height="'+theImgH+'" border="0">';
			}
		} else {
			document.getElementById("PhotoGallery_"+i).style.display = "none";	
			if (document.getElementById("gal"+i)) {
			  document.getElementById("gal"+i).style.backgroundColor = "#DFDFDF";
			}
		}
	}
	
	//products_34_ShowGallery(theOwnId, theGalNum, theLang);
}


function products_34_UpdateBigPhoto(theBigPhotoPath, theImgW, theImgH, theDescr) {
	
	var bigphoto = document.getElementById("BigPhoto");
	if (document.getElementById("BigPhoto")) {
		bigphoto.innerHTML = '<img src="' + theBigPhotoPath + '" width="'+theImgW+'" height="'+theImgH+'" alt="'+theDescr+'" border="0">';
	}
	
}

function products_34_showEnquiry(theId, theLang) {
	w_width = 700;
	w_height = 620;
	if (screen) {
		w_left = (screen.availWidth - w_width)/2;
		w_top = ((screen.availHeight - w_height)/2)-20;
	}
	theWindowParam = 'width='+w_width+',height='+w_height+',left='+w_left+',top='+w_top+',status=no,resizable=yes,scrollbars=yes';

	fparam = 'templates/ws_mm_products_34/showenquiry.php?pageid=' + theId + '&lang=' + theLang;
  window.mm_products_34_photoGalleryWindow = open(fparam, 'mm_products_34_photoGalleryWindow', theWindowParam);
	setTimeout('if(mm_products_34_photoGalleryWindow&&!mm_products_34_photoGalleryWindow.closed)mm_products_34_photoGalleryWindow.focus()',100);
}


function products_34_ShowGallery(theOwnId, theGalNum, theLang) {
	
	var ajaxRequest;  // The variable that makes Ajax possible!

	try {
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try {
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Something is wrong with your browser!");
				return false;
			}
		}
	}

	initSlideShow;
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById("GalleryArea");
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	//var cbx_id = document.getElementById(theMasterField).value;
	var queryString = "?ownid=" +theOwnId+"&galnum="+theGalNum+"&lang="+theLang;
	//alert(queryString);
	ajaxRequest.open("GET", "templates/ws_mm_products_34/refresh_gallery.php" + queryString, true);
	ajaxRequest.send(null); 
	
}

/* functions for template ws_mm_standard_33 */

function standard_33_UpdateBigPhoto(theBigPhotoPath, theImgW, theImgH, theDescr) {
	
	var DescrExist = 'N';
	if (theDescr != '') {
		DescrExist = 'Y';
	}
	var bigphoto = document.getElementById("BigPhoto");
	var photoDescr = document.getElementById("BigPhoto_Descr");
	if (document.getElementById("BigPhoto")) {
		bigphoto.innerHTML = '<img src="' + theBigPhotoPath + '" width="'+theImgW+'" height="'+theImgH+'" border="0">';
	}
	if (document.getElementById("BigPhoto_Descr")) {
		photoDescr.innerHTML = theDescr;
	}
	
	if (DescrExist == 'Y') {
		document.getElementById("DescrBlock").style.display = 'block';
		document.getElementById("DescrBlock").style.width = theImgW;
	} else {
		document.getElementById("DescrBlock").style.display = 'none';
	}
}

function standard_33_HidePhotoDescr() {
	document.getElementById("DescrBlock").style.display = 'none';
}