//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
/*
var message="Copyright CandidImage.com";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")
 */
//window open function

function wopen(url,title,top,left,width,height)
{     var win_handle = null;

    //closing an already opened window
    if (win_handle) {
        win_handle.close();
    }
         //creating the new window
        win_handle = window.open(url,title,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,top=" + top + ",left=" + left + ",width=" + width + ",height=" + height);
        win_handle.focus();
    return false;

}

//Highlight form element- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

var highlightcolor="#CBD2CA"

var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}

//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor='#E2E1DD'
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

function confsubmit()
{
var Message='Please correct the following errors:\n';
var tempmsg='';
  if (document.contactform.sendersname.value=='')
  {
   tempmsg=tempmsg + 'Please enter your name\n'
  }
  if ((document.contactform.sendersemail.value=='') || (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.contactform.sendersemail.value))))
  {
   tempmsg=tempmsg + 'Please enter a valid e-mail\n'
  }

  if (document.contactform.message.value=='')
  {
    tempmsg=tempmsg + 'Please type in your message\n'
  }

    if(tempmsg=='')
    {
    document.contactform.submit();
    }
    else
    {
     Message=Message + '=======================\n' +  tempmsg + '=======================';
     alert(Message);
    }
}


function confsign()
{
var Message='Please correct the following errors:\n';
var tempmsg='';
  if (document.gbookform.name.value=='')
  {
   tempmsg=tempmsg + 'Please enter your name\n'
  }
  if ((document.gbookform.email.value=='') || (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.gbookform.email.value))))
  {
   tempmsg=tempmsg + 'Please enter a valid e-mail\n'
  }

  if (document.gbookform.textarea.value=='')
  {
    tempmsg=tempmsg + 'Please type in your comments\n'
  }

    if(tempmsg=='')
    {
    document.gbookform.submit();
    }
    else
    {
     Message=Message + '=======================\n' +  tempmsg + '=======================';
     alert(Message);
    }
}

function toggle(target)
  {
     obj=(document.all) ? document.all[target] : document.getElementById(target);
     obj.style.display=(obj.style.display=='none') ? 'inline' : 'none';
  }
function revtoggle(target)
  {
     obj=(document.all) ? document.all[target] : document.getElementById(target);
     obj.style.display=(obj.style.display=='inline') ? 'none' : 'inline';
  }

//swapping functions

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//preloading functions
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//sound control function

function MM_controlSound(x, _sndObj, sndFile) { //v3.0
  var i, method = "", sndObj = eval(_sndObj);
  if (sndObj != null) {
    if (navigator.appName == 'Netscape') method = "play";
    else {
      if (window.MM_WMP == null) {
        window.MM_WMP = false;
        for(i in sndObj) if (i == "ActiveMovie") {
          window.MM_WMP = true; break;
      } }
      if (window.MM_WMP) method = "play";
      else if (sndObj.FileName) method = "run";
  } }
  if (method) eval(_sndObj+"."+method+"()");
  else window.location = sndFile;
}

/////
function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function handleError() {
    return true;
}
 //error handling for the sound menu and others
 
window.onerror = handleError;