// JavaScript Document
<!--
function notChecked(ss) {
	if(ss.checked)
	{
		return false;
	}
	return true;
}
	
function toggleLayer(whichLayer/*,imgDiv*/)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(whichLayer).style;
style2.display = style2.display? "":"block";
}
else if (document.all)
{
// this is the way old msie versions work
var style2 = document.all[whichLayer].style;
style2.display = style2.display? "":"block";
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[whichLayer].style;
style2.display = style2.display? "":"block";
}

		/*//this will display correspondance icon up/down if configured
		if(imgDiv!=undefined){
			//cache two images

			imageUp = new Image();
			imageUp.src = "images/up.gif";
			imageDown = new Image();
			imageDown.src = "images/down.gif";
	
			if(style2.display=="block"){
			imgDiv.innerHTML="<img src='" + imageUp.src + "' border=0>";  //change to the Down Arrow					
			}else{
			imgDiv.innerHTML="<img src='" + imageDown.src + "' border=0>";  //change to the Down Arrow
			}
		}*/
}

function hideLayer(whichLayer) {

if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "hidden";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "hidden";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "hidden";
}
}

function showLayer(whichLayer) {
if (document.getElementById) {
// this is the way the standards work
document.getElementById(whichLayer).style.visibility = "visible";
}
else if (document.all) {
// this is the way old msie versions work
document.all[whichlayer].style.visibility = "visible";
}
else if (document.layers) {
// this is the way nn4 works
document.layers[whichLayer].visibility = "visible";
}
}


function chkDigit(field){
	var regdigit=/^(([0-9])*[- .(]*([0-9])*[- .)]*[0-9][- .]*[0-9])+$/;
	if(!regdigit.test(field.value)){
		return true;
	}
return false;
}

function chkCharacter(field){
	var regchar=/^[\w\s]+$/;
	if(!regchar.test(field.value)){
		return true;
	}
return false;
}

function chkEmail(field){
	var emailexp= /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	if(!emailexp.test(field.value)){
		return true;
	}
return false;
}

function chkEmpty(field){
	if(trim(field.value) == ""){
		return true;
	}
return false;
}

function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}

function SelectOption(OptionListName, ListVal){
	for (i=0; i < OptionListName.length; i++){
		if (OptionListName.options[i].value == ListVal){
			OptionListName.selectedIndex = i;
			break;
		}
	}
}

function adWindow(mypage,myname,w,h,scroll,res){
	var ad = null;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=no,statusbar=yes'
	ad = window.open(mypage,myname,settings)
	ad.focus();
}

function CheckAll(frm){
	var len = frm.elements.length;
	if (frm.AC.checked==true){
	    for (var i = 0; i < len; i++){
	      	frm.elements[i].checked=true;
	     }
	}
	else{
	      for (var i = 0; i < len; i++){
	       	frm.elements[i].checked=false;
	      }
	}
	
}

function compareDates(sep,sdate,edate){

	var aPart = sdate.split(sep);
	var bPart = edate.split(sep);
	
	var startDate = new Date(parseInt(aPart[0],10),parseInt(aPart[1]-1,10),parseInt(aPart[2],10));
	var endDate = new Date(parseInt(bPart[0],10),parseInt(bPart[1]-1,10),parseInt(bPart[2],10));
	var sDiff = endDate.valueOf() - startDate.valueOf();
	if(sDiff<0)
    return true;//start date is leass then curren date so problem exist
	else
	return false; //check validation false so every thing fine.
}

function dynamiccontentNS6(elementid,content){
	if (document.getElementById){
		rng = document.createRange();
		el = elementid;//document.getElementById(elementid);
		rng.setStartBefore(el);
		htmlFrag = rng.createContextualFragment(content);
		while (htmlFrag.hasChildNodes())
			el.appendChild(htmlFrag);
	}
}
function showDiv(){
	row1 = document.getElementById("row1");
	row2 = document.getElementById("row2");
	row3 = document.getElementById("row3");
	var browser = getBrowser();
	if("ie" == browser)
		row3.style.display = 'inline';
	else
		row3.style.display = 'table-row';
		
	document.sendShare.email.value = "";
	document.sendShare.email.focus();
	row1.style.display="none";
	row2.style.display="none";
}
function hideDiv(){	
	row1 = document.getElementById("row1");
	row2 = document.getElementById("row2");
	row3 = document.getElementById("row3");
	row3.style.display="none";
	var browser = getBrowser();
	if("ie" == browser){
		row1.style.display = 'inline';
		row2.style.display = 'inline';
	}
	else{
		row1.style.display = 'table-row';
		row2.style.display = 'table-row';
	}
}
function getBrowser(){	
	if (window.ActiveXObject)	  return "ie";
	if (window.XMLHttpRequest)	  return "firefox";
}
-->