// JavaScript Document

$(document).ready(function(){

	$('#frmFooterCode').submit(function(){
		if($('#frmFooterCode #txtCode').val() == '')
		{
			alert("Please enter Coupon.");
			$('#frmFooterCode #txtCode').focus();
			return false;
		}
	});
	
	$("#frmUploadPhotos").validate();
	$("#frmCorporate").validate();
	$("#frmAppointment").validate();

});


menuHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" menuHover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" menuHover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", menuHover);


function NewWin(url, name, w, h)
{
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  
  if(win)

  {

    if(!win.closed) win.close();

  }
  
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=no, resizable=yes');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}

function NewWinScrolls(url, name, w, h)
{
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  
    if(win)

  {

    if(!win.closed) win.close();

  }
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=yes');
  // Just in case width and height are ignored
  try
  {
  	win.resizeTo(w, h);
	win.moveTo(wleft, wtop);
  }
  catch(exception)
  {}
  win.focus();
}

