<!--
// Document Created by F.Dirol, http://www.studioturk.com
// Last Modified: 30.05.2008
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  return foundObj;
}

function showHideLayers()
{ 
  var i, visStr, obj, args = showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3)
  {
    if ((obj = findObj(args[i])) != null)
    {
      visStr = args[i+2];
      if (obj.style)
      {
        obj = obj.style;
        if(visStr == 'show') visStr = 'visible';
        else if(visStr == 'hide') visStr = 'hidden';
      }
      obj.visibility = visStr;
    }
  }
}
function disableRightClick(){  
var message = "Sorry, Right Click disabled !";
  if(!document.rightClickDisabled)
  { if(document.layers) 
    { document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick; }
  else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true; }
  if(document.layers || (document.getElementById && !document.all))
  { if (e.which==2||e.which==3)
    { alert(message);
      return false; }}
  else{ alert(message);
    return false; }}
function disableselect(e){
return false
}
function reEnable(){
return true
}

function tick() {
  var hours, minutes, seconds, ap;
  var intHours, intMinutes, intSeconds;
  var today;
  today = new Date();
  intHours = today.getHours();
  intMinutes = today.getMinutes();
  intSeconds = today.getSeconds();
  if (intHours == 0) {
     hours = "12:";
     ap = "A.M.";
  } else if (intHours < 12) { 
     hours = intHours+":";
     ap = "A.M.";
  } else if (intHours == 12) {
     hours = "12:";
     ap = "P.M.";
  } else {
     intHours = intHours - 12
     hours = intHours + ":";
     ap = "P.M.";  }
  if (intMinutes < 10) {
     minutes = "0"+intMinutes+":";
  } else {
     minutes = intMinutes+":";  }
  if (intSeconds < 10) {
     seconds = "0"+intSeconds+" ";
  } else {
     seconds = intSeconds+" ";  } 
timeString = hours+minutes+seconds+ap;
clock.innerHTML = timeString;
window.setTimeout("tick();", 100); }

//--------Input restriction

function restrictinput(maxlength,e,placeholder){
var ns6=document.getElementById&&!document.all
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation() }}
function countlimit(maxlength,e,placeholder){
var ns6=document.getElementById&&!document.all
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft }}

function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b>'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); }}

-->