function setopacity(subject,divId,subjectDiv,imgLink,tooltip){

var objdiv = document.getElementById(divId);
var width  = document.body.clientWidth;
var height = document.body.clientHeight;
var objsubjectDiv = document.getElementById(subjectDiv);
var objimgLink=document.getElementById(imgLink);
var bodywidth=document.body.clientWidth;
var bodyheight=document.body.clientHeight;

objsubjectDiv.innerHTML="<table  border='0' cellspacing='0' cellpadding='0'><tr><td width='12' height='12'><img src='images/them1.gif' width='12' height='12' /></td><td background='images/them2.gif' height='12'><img src='images/spacer.gif' /></td><td width='12' height='12'><img src='images/them3.gif' width='12' height='12' /></td></tr><tr><td background='images/them4.gif' width='12'><img src='images/spacer.gif' /></td><td bgcolor='#DBA679' align='left' ><img src='"+subject+"' border='2' width='700' height='500' title='"+tooltip+"' onmouseout='return wclose(\""+divId+"\",\""+subjectDiv+"\");'/></td><td background='images/them5.gif' width='12'><img src='images/spacer.gif' /></td></tr><tr><td width='12' height='12'><img src='images/them6.gif' width='12' height='12' /></td><td background='images/them7.gif' height='12'><img src='images/spacer.gif' /></td><td width='12' height='12'><img src='images/them8.gif' width='12' height='12' /></td></tr></table>";
objsubjectDiv.style.position="absolute";
objsubjectDiv.style.zIndex="3";
objsubjectDiv.focus();
var x=findPosX(objimgLink);
var y=findPosY(objimgLink);
objsubjectDiv.style.top=y+"px";
templeft=Math.ceil((bodywidth-600)/2);
temptop=Math.ceil((bodyheight-400)/2);
objsubjectDiv.style.left=templeft+"px";
objsubjectDiv.style.top=temptop+"px";


objdiv.style.display="block";
objdiv.style.zIndex="2";
objdiv.style.top="0px";
objdiv.style.left="0px";
objdiv.style.width=bodywidth+100+"px";
objdiv.style.height=bodyheight+150+"px";
objdiv.style.position="absolute";
objdiv.style.opacity=.6;
objdiv.style.backgroundColor="#6C6C6C";
objdiv.style.filter = 'alpha(opacity=' + 60 + ')';

return false;
}

function  wclose(divId,subjectDiv){


var objdiv = document.getElementById(divId);
var objsubjectDiv = document.getElementById(subjectDiv);
objdiv.style.display="inline";
objdiv.style.zIndex="1";

objdiv.style.top="0px";
objdiv.style.left="0px";
objdiv.style.width="0px";
objdiv.style.height="0px";
objdiv.style.position="absolute";
objdiv.style.opacity="";
objdiv.style.backgroundColor="#00CCFF";
objdiv.style.filter = "";

objsubjectDiv.innerHTML="";
objsubjectDiv.style.zIndex="1";
objsubjectDiv.style.top="0px";
objsubjectDiv.style.left="0px";
objsubjectDiv.style.width="0px";
objsubjectDiv.style.height="0px";
return false;
}

function findPosX(obj) {
   //alert(obj);
   var curleft = 0;
    if (obj.offsetParent) {
        while (1) {
            curleft+=obj.offsetLeft;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.x) {
        curleft+=obj.x;
    }
    return curleft;
}

function findPosY(obj) {
      // alert(obj);
    var curtop = 0;
    if (obj.offsetParent) {
        while (1) {
            curtop+=obj.offsetTop;
            if (!obj.offsetParent) {
                break;
            }
            obj=obj.offsetParent;
        }
    } else if (obj.y) {
        curtop+=obj.y;
    }
    return curtop;
}


// --- E M A I L  F U N C T I O N 
function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if(emailStr=="")
{ return true}
if (matchArray==null) {

	return false
}
var user=matchArray[1]
var domain=matchArray[2]
if (user.match(userPat)==null) {

    return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
 	  for (var i=1;i<=4;i++){
	    	if (IPArray[i]>255) 	{

			return false
	    				}
				}
    		return true	
		}

var domainArray=domain.match(domainPat)
if (domainArray==null) {

    return false
}
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 ||
    domArr[domArr.length-1].length>7) {

   return false
}
if (len<2) {
   var errStr="This address is missing a hostname!"

   return false
}
return true;
}
//  --- end  E M A I L  F U N C T I O N 
function validation(){
	
	var objidtxtname=document.getElementById("idtxtname");
	var objidtxtform=document.getElementById("idtxtform");
	var objidtxtSubject=document.getElementById("idtxtSubject");
	var objidtxtcontent=document.getElementById("idtxtcontent");
	var objerrtxtname=document.getElementById("errtxtname");
	var objerrtxtform=document.getElementById("errtxtform");
	var objerrtxtSubject=document.getElementById("errtxtSubject");
	var objerrtxtcontent=document.getElementById("errtxtcontent");
	var error="";
	
	if(objidtxtname.value==""){
	objerrtxtname.innerHTML="Name should not be blank!";
	error="false";
	}else{
	objerrtxtname.innerHTML="";	
	}
    
	if(objidtxtform.value==""){
	objerrtxtform.innerHTML="E-mail should not be blank!";
	error="false";
	}else if(emailCheck(objidtxtform.value)==false){
	objerrtxtform.innerHTML="Incorrect E-mail address!";
	error="false";
	}else{
	objerrtxtform.innerHTML="";
	}
    
	if(objidtxtSubject.value==""){
	objerrtxtSubject.innerHTML="Subject should not be blank!";
	error="false";
	}else{
	objerrtxtSubject.innerHTML="";
	}
    
	if(objidtxtcontent.value==""){
	objerrtxtcontent.innerHTML="Content should not be blank!";
	error="false";
	}else{
	objerrtxtcontent.innerHTML="";
	}
	
	if(error=="false"){
		return false;
	}else{
	    return true;
	}
}
