// JavaScript Document
// Images security
var message = "Access Denied!";
function protect(e) {
alert(message);
return false;
}
function trap() {
if(document.images)
for(i=0;i<document.images.length;i++)
if(document.images[i].id!="aaa")
{
document.images[i].ondragstart = protect;
}
}
// right click disabled
document.oncontextmenu=new Function("(message);return false")
//Text disabled
 /*function disableselect(e){
return false
} 
function reEnable(){
return true
} 
document.onselectstart=new Function ("return false") 
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}*/
// Hide Print Screen option works only in IE
document.onkeydown=pasted; 
function pasted()
{
window.clipboardData.clearData();
}

// Browser Detect for Chrome
function detectBrowser(){
var browserName=navigator.appName;
var browserVer=navigator.appVersion;
//alert(browserVer.indexOf("Chrome"));
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")

if(browserName == "Netscape" && browserVer.indexOf("Chrome")==-1){
  fileref.setAttribute("href", "css/style.css")
}
else if(browserName == "Microsoft Internet Explorer"){
fileref.setAttribute("href", "css/style.css")
}
else if(browserName == "Netscape" && browserVer.indexOf("Chrome")!=-1){
fileref.setAttribute("href", "css/stylechr.css")
}
if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}

// Browser Detect for Chrome (ONLY Home Page)
function homedetectBrowser(){
var browserName=navigator.appName;
var browserVer=navigator.appVersion;
//alert(browserVer.indexOf("Chrome"));
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")

if(browserName == "Netscape" && browserVer.indexOf("Chrome")==-1){
  fileref.setAttribute("href", "html/css/style.css")
}
else if(browserName == "Microsoft Internet Explorer"){
fileref.setAttribute("href", "html/css/style.css")
}
else if(browserName == "Netscape" && browserVer.indexOf("Chrome")!=-1){
fileref.setAttribute("href", "html/css/stylechr.css")
}
if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}

// Browser Redirect for Home Page
function browserredirect()
{
var browserName=navigator.appName;
var browserVer=navigator.appVersion;
if(browserName == "Netscape" && browserVer.indexOf("Chrome")==-1)
{ 
window.location="home1.htm";
}
else
{ 
 if (browserName=="Microsoft Internet Explorer")
 {
  window.location="home1.htm";
 }
 else
  {
   window.location="home2.htm";
   }
}
}

