var isOpera=navigator.userAgent.indexOf("Opera")>-1;
var isIE=navigator.userAgent.indexOf("MSIE")>1&&!isOpera;
var isMoz=navigator.userAgent.indexOf("Mozilla/5.")==0&&!isOpera;
var theCurrentDate=new Date();
function initialfocus(){
thisObject=document.forms[0];
for(var i=0;i<thisObject.elements.length;i++){
theElement=thisObject.elements[i];
if(theElement.type=="text"){
thisObject.elements[i].focus();
break;
}
}
}
function disableForm(theform){
if(document.all||document.getElementById){
for(var i=0;i<theform.length;i++){
var tempobj=theform.elements[i];
tempobj.disabled=true;
}
}
}
function zzChopit(aString,aSubstring)
{
var tmp=""+aString
if(tmp.length==0)return tmp
if(aSubstring.length==0)return tmp
var where
if((where=tmp.indexOf(aSubstring))<0)return tmp
return(tmp.substring(0,where))
}
function zzLopit(aString,aSubstring)
{
var tmp=""+aString
if(tmp.length==0)return tmp
if(aSubstring.length==0)return tmp
var where
if((where=tmp.indexOf(aSubstring))<0)return tmp
return(tmp.substring(where+aSubstring.length,tmp.length))
}

function searchEntryForm(){
document.writeln("<a href=\"javascript:searchDocument()\" class=\"button\">Search</a>");
}
function searchDocument(){
cDate=new Date();
timeStamp="&timestamp="+Date.parse(cDate);
mySearchField=document.forms[0].searchfield.value;
if(mySearchField==""){
alert("Please enter search keyword(s).");
document.forms[0].searchfield.focus();
return;
}
var iChars="!@#$%^&*()+=-[]\\\;,/{}|\:<?";
for(var i=0;i<document.forms[0].searchfield.value.length;i++){
iCharIs=iChars.indexOf(document.forms[0].searchfield.value.charAt(i));
if(iCharIs!=-1){
theChar=iChars.substr(iCharIs,1);
alert("Your keyword has special characters. \n\""+theChar+"\" sign. This is not allowed.\n Please remove them and try again.");
return;
}
}
myCondition="&description="
+mySearchField
;
myFormAction=pathname+"/Search?perform="+myCondition+timeStamp;
alert(myFormAction);
window.location.href=myFormAction;
}
function getHeight(){

var d=document;
var box=new Array("index2leftSide","index2rightSide");
for(x=0;x<box.length;x++){
h=d.getElementById(box[x]).offsetHeight;
for(y=0;y<box.length;y++){
test_h=d.getElementById(box[y]).offsetHeight;
if(h<test_h)h=test_h;
}
}
for(x=0;x<box.length;x++)d.getElementById(box[x]).style.height=h+"px";
if(navigator.userAgent.indexOf("Opera")!=-1){
var versionindex=navigator.userAgent.indexOf("Opera")+6
if(parseInt(navigator.userAgent.charAt(versionindex))>=8){
document.getElementById("watermarkLogo").style.backgroundImage='none';
document.getElementById("watermarkZone").style.display='none';
}
}
}
function indexGetHeight(){
var d=document;
var box=new Array("leftSide","middleSide","rightSide");
for(x=0;x<box.length;x++){
h=d.getElementById(box[x]).offsetHeight;
for(y=0;y<box.length;y++){
test_h=d.getElementById(box[y]).offsetHeight;
if(h<test_h)h=test_h;
}
}
for(x=0;x<box.length;x++)d.getElementById(box[x]).style.height=h+"px";
if(navigator.userAgent.indexOf("Opera")!=-1){
var versionindex=navigator.userAgent.indexOf("Opera")+6
if(parseInt(navigator.userAgent.charAt(versionindex))>=8){
document.getElementById("watermarkLogo").style.backgroundImage='none';
document.getElementById("watermarkZone").style.display='none';
}
}
}
function adjustScreen(){
if(screen.width==800){
document.getElementById("column1").style.fontSize="11px";
document.getElementById("column2").style.fontSize="11px";
document.getElementById("column3").style.fontSize="11px";
document.getElementById("column4").style.fontSize="11px";
document.getElementById("column5").style.fontSize="11px";
document.getElementById("column6").style.fontSize="11px";
}
}
function checkNull4Search(){
if(document.forms[0].description.value==""){
return false;
}
else{
document.forms[0].submit();
}
}
function disableSearch(){
return false;
}

function addLoadEvent(func) {

  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }

}


//function getHeight4Hide(){

	
   //var d=document;
   //var l=0;
   //var r=0;

	
   //l = d.getElementById("index2leftSide").offsetHeight;
   //r = d.getElementById("index2rightSide").offsetHeight;

  
   //if (l > r){
   //   d.getElementById("index2rightSide").style.height=l+"px";
   //}
   //else{
   //   d.getElementById("index2rightSide").style.height=l+"px";	
   //}
		
//}


