var message="Copyrighted";

function clickIE6(){

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=clickIE6;

}

document.oncontextmenu=new Function("alert(message);return false")


 

//Copy Right
function copyright() {	
	var startYear="2010";
    date = new Date();
    year = date.getYear();
    if ( (year - startYear) > 0){
       document.write(startYear + "-" + year);
    }else{
     document.write(startYear);
    } 
}


function EmbedFlash(swf,w,h){
// Main Flash animation - XHTML 1.0 compliant workaround for IE and Firefox (write as javascript rather then embed HTML))
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="main01" width="'+w+'" height="'+h+'">');
document.write('<param name="movie" value="'+swf+'"/>');
document.write('<param name="quality" value="high"/>');
document.write('<param name="base" value=""/>');
document.write('<param name="allowScriptAccess" value="always">');
document.write('<param name="wmode" value="transparent"/>');
document.write('<param name="loop" value="true"/>');
document.write('<embed type="application/x-shockwave-flash" wmode="transparent" src="'+swf+'"  width="'+w+'" height="'+h+'"></embed>');
document.write('</object>');	
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


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];}}
}

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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

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];}
}

 
 
function validateenquiry(form){
if (form.firstname.value=='') {alert('Please fill in your name'); form.firstname.focus(); return false}
if (form.email.value=='') {alert('Please fill in your email id'); form.email.focus(); return false}
if (!CheckEmail(form.email.value)) {alert('Invalid email id'); form.email.focus(); return false}
if (form.phone.value=='') {alert('Please fill your contact phone no'); form.phone.focus(); return false}
if (form.comments.value=='') {alert('Please describe comments'); form.comments.focus(); return false}
if (form.security_code.value=='') {alert('Please provide the security code provided below');form.security_code.focus();return false}
} 
 
function CheckEmail(address) {
if (/^\w{2,30}([\.-]?\w{2,30})*@\w{2,30}([\.-]?\w+)*(\.\w{2,3})+$/.test(address)){
	return (true)
	}
	return (false)
}

function IsChar(strString)
{

var strValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-.' ,"; 

 var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
 return blnResult;	
	}

function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
 return blnResult;
}
function IsSpecial(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
 return blnResult;
}

function changeVideo(swf,displaythis){
	var w=380;
	var h=300;
swf="http://www.youtube.com/v/" + swf + "&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1";
var filedisplay;
filedisplay='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="main01" width="'+w+'" height="'+h+'">' + '<param name="movie" value="'+swf+'"/>' + '<param name="quality" value="high"/>' + '<param name="allowFullScreen" value="true"/>' + '<param name="base" value="true"/>' + '<param name="loop" value="true"/>' +'<param name="wmode" value="transparent"/>' + '<embed type="application/x-shockwave-flash"  allowfullscreen="true" src="'+swf+'" width="'+w+'" height="'+h+'"></embed>' + '</object>';

document.getElementById("videodiv").innerHTML=filedisplay;
document.getElementById("videodesc").innerHTML=displaythis;
}

function Load(id,no)
{
for (var i=1; i<=no; i++) {
	document.getElementById('c' + i).style.display="none";
	}
	document.getElementById('c' + id).style.display = "block";
}

function show(displayItem)
{var dItem=document.getElementById(displayItem);
dItem.style.display='inline';}

function hide(displayItem)
{var dItem=document.getElementById(displayItem);
dItem.style.display='none';}

function validatelogin(form)
  {
	if(form.email.value==""){alert("Please Enter email ID");form.email.focus();return false;}
if (!CheckEmail(form.email.value)) {alert('Invalid email id'); form.email.focus(); return false}	
	if(form.password.value==""){alert("Please Enter password");form.password.focus();return false;}	
	return true;
  }
  
  function validatelogin2(form)
  {
	if(form.username.value==""){alert("Please Enter username");form.username.focus();return false;}
	if(form.password.value==""){alert("Please Enter password");form.password.focus();return false;}	
	return true;
  }
  
  
function popup(URL) {
mywin=window.open(URL,'aa','scrollbars=no,width=790,height=730,left=0,top=0,statusbar=0');
	mywin.focus();
 }
 
function popup2(URL,w,h) {
     var winl = (screen.width - w) / 2;
     var wint = (screen.height - h) / 2;
     winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=1,scrollbars=yes'
   window.open(URL, "", winprops)
 } 
 
 function popup3(URL) {
     winprops = 'height='+screen.width+',width='+screen.width+',top=0,left=0, resizable=1,scrollbars=yes'
   window.open(URL, "", winprops)
 } 

function validateCheckbox(vfld,   // checkboxes to be validated
                            nr,     // number of checkboxes to be checked. >=2
                            cond)   // condition: -1 = less than or equal to nr
                                   //             0 = equal to nr (default)
                                    //             1 = greater than or equal to nr
{
  alert('fdas');
  if (!cond) cond = 0;
  // count how many boxes have been checked by the reader
  var count = 0;
  for (var j=0; j<vfld.length; j++)
     if (vfld[j].checked) count++;

  if (count==nr) return true;
  if (count<nr && cond==-1) return true;
  if (count>nr && cond==1)  return true;

  // if we get here then the validation has failed

  var suffix='';
  if (count>1) suffix='es';

  var errorMsg;

  if (count<nr) errorMsg = 'Only ' + count + ' box' + suffix + ' checked: ' + nr + ' required';
  if (count>nr) errorMsg = '' + count + ' boxes checked: maximum ' + nr + ' allowed';
  if (count==0) errorMsg = 'No boxes checked: ' + nr + ' required';

 alert(errorMsg);
  return false;
}
 
 
function Toggle(thediv) { 
document.getElementById('dollar').style.display = "none"; 
document.getElementById("rs").style.display = "none"; 
document.getElementById(thediv).style.display = "block"; 
}  
