// JavaScript Document
function displayMessage(){
	if (getQueryVariable("send") == "yes"){
		document.write("<FONT color='green'><B>Your message has been sent. Thank You.</B></FONT>");	
	}
}


//General Library
function getQueryVariable(variable) {
	try{
		var query = new String(window.location.search);
		var vars = query.split("&");
		for (var i=0;i<vars.length;i++) {
			var pair = vars[i].split("=");
			if (pair[0] == variable) {
				var sVal = pair[1];
				sVal = sVal.replace(/\+/gi," ");
				return unescape(sVal);
			}
		} 
		return "";
	}catch(ex){return "";}
}
function getFileContent(filename){
	try{
		if(navigator.appName == "Microsoft Internet Explorer")
			objHttp = new ActiveXObject("Microsoft.XMLHTTP");
		else
			objHttp = new XMLHttpRequest();
		
		objHttp.open("GET", filename, false);
		objHttp.send(null);
		var strDoc = objHttp.responseText;
		return strDoc;
	}catch(ex){return "";}
}
function sendFileContent(fileContent,stype){
	try{
		if( navigator.appName == "Microsoft Internet Explorer")
			objHttp = new ActiveXObject("Microsoft.XMLHTTP");
		else
			objHttp = new XMLHttpRequest();
			
		objHttp.open("Post", url ,false);
		objHttp.send(fileContent);
		var strDoc = objHttp.responseText;
		return strDoc;
	}catch(ex){return "";}
}
function resize(){try {if (null!=document.getElementById('expand') && getHeight()>132){document.getElementById('expand').height = getHeight()-132;} if ("Map_Subject_Search"==page){map.ResizeMap();}}catch(ex){}}
function GetCookie(name){
	var start = document.cookie.indexOf(name + "="); 
	var len = start + name.length + 1;
	if ((start == -1) || ((!start) && (name != document.cookie.substring(0,name.length)))){return null;}
	var end = document.cookie.indexOf(";",len);
	if (end == -1){end = document.cookie.length;}
	return unescape(document.cookie.substring(len,end));
}
function SetCookie(name,value){
	document.cookie = name + "=" + escape(value) + ";expires=Thu, 01-Jan-2010 00:00:01 GMT; path=/";
}
function Delete_Cookie(name){ 
	if (Get_Cookie(name)){document.cookie =  name + '=; path=/';}
}
function showHide(method,section){try{var sectionObj = document.getElementById(section);if (null!=sectionObj){if (method == "open" ){sectionObj.style.display = "inline";}else if (method == "close"){sectionObj.style.display = "none";}}}catch(ex){}}
function showContent(content,target){try{content = "<FONT class='sub'>"+content+"</FONT>";var showContentObj = document.getElementById(target);if (null!=showContentObj){ /*&&null!=showContentObj.innerHTML*/if(showContentObj.innerHTML!=content){showContentObj.innerHTML = content;}else{showContentObj.innerHTML = "";}}}catch(ex){}}
function createTableOpen_bak(){document.write("<TABLE cellspacing=0 cellpadding=0 border=0 align=center><TR><TD bgcolor=#cccccc colspan=2 height=7 rowspan=2><IMG height=7 src=\"../images/corner1.gif\" width=7></TD><TD bgcolor=#cccccc height=1> <IMG height=1 src=\"../images/clearpixel.gif\" border=0></TD><TD bgcolor=#cccccc colspan=2 height=7 rowspan=2> <IMG height=7 src=\"../images/corner2.gif\" width=7></TD>\
	 </TR><TR valign=top><TD><IMG height=6 src=\"../images/clearpixel.gif\" width=1 border=0></TD></TR><TR valign=top><TD width=1 bgcolor=#cccccc><IMG height=1 src=\"../images/clearpixel.gif\" width=1 border=0></TD><TD width=6> <IMG height=1 src=\"../images/clearpixel.gif\" width=6 border=0></TD><TD bgcolor=\"#FFFFFF\" valign=\"top\">");}
function createTableClose_bak(){document.write("</TD><TD width=6><IMG height=1 src=\"../images/clearpixel.gif\" width=6 border=0></TD><TD width=1 bgcolor=#cccccc><IMG height=1 src=\"../images/clearpixel.gif\" width=1 border=0></TD></TR><TR valign=bottom><TD colspan=2 height=7 rowspan=2> <IMG height=7 src=\"../images/corner3.gif\" width=7></TD><TD><IMG height=6 src=\"../images/clearpixel.gif\" width=1 border=0></TD>\
     <TD colspan=2 height=7 rowspan=2><IMG height=7 src=\"../images/corner4.gif\" width=7></TD></TR><TR><TD bgcolor=#cccccc><IMG height=1 src=\"../images/clearpixel.gif\" border=0></TD></TR></TABLE>");}
function createTableOpenCut(){document.write("<TABLE cellspacing='0' cellpadding='0' border='0' align='center'><!--TR><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner1.gif' width='7'></TD><TD style='border-top: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner2.gif' width='7'></TD></TR><TR valign='top'><TD><IMG height='5' src='../images/clearpixel.gif' width='1' border='0'></TD></TR--><TR valign='top'><TD width='1' style='border-left: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD bgcolor='#FFFFFF' valign='top'>");}
function createTableCloseCut(){document.write("</TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD width='1' style='border-right: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='bottom'><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner3.gif' width='7'></TD><TD style='border-bottom: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner4.gif' width='7'></TD></TR></TABLE>");}
function createTableOpen(){document.write("<TABLE cellspacing='0' cellpadding='0' border='0' align='center'><TR><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner1.gif' width='7'></TD><TD style='border-top: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner2.gif' width='7'></TD></TR><TR valign='top'><TD><IMG height='5' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='top'><TD width='1' style='border-left: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD bgcolor='#FFFFFF' valign='top'>");}
function createTableClose(){document.write("</TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD width='1' style='border-right: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='bottom'><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner3.gif' width='7'></TD><TD style='border-bottom: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner4.gif' width='7'></TD></TR></TABLE>");}
function getTableOpen(){return ("<TABLE cellspacing='0' cellpadding='0' border='0' align='center'><TR><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner1.gif' width='7'></TD><TD style='border-top: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner2.gif' width='7'></TD></TR><TR valign='top'><TD><IMG height='5' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='top'><TD width='1' style='border-left: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD bgcolor='#FFFFFF' valign='top'>");}
function getTableClose(){return ("</TD><TD width='5'><IMG height='1' src='../images/clearpixel.gif' width='5' border='0'></TD><TD width='1' style='border-right: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD></TR><TR valign='bottom'><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner3.gif' width='7'></TD><TD style='border-bottom: 1px solid #BBBBBB;'><IMG height='1' src='../images/clearpixel.gif' width='1' border='0'></TD><TD colspan='2' height='7' rowspan='2'><IMG height='7' src='../images/corner4.gif' width='7'></TD></TR></TABLE>");}
function getHeight(){if (window.innerWidth){w = window.innerWidth; h= window.innerHeight;}else if (document.all){w = document.body.clientWidth; h = document.body.clientHeight;}return h;}
function getWidth(){if (window.innerWidth){w = window.innerWidth; h= window.innerHeight;}else if (document.all){w = document.body.clientWidth; h = document.body.clientHeight;}return w;}
function createTableOpen_withshade(){document.write("<TABLE cellspacing=0 cellpadding=0 align=center border=0><TR><TD><IMG height=6 alt='' src='../images/tbllt1.gif' width=9 border=0></TD><TD background=../images/tblt1.gif><IMG src='../images/tblo.gif'></TD><TD><IMG height=6 alt='' src='../images/tblrt1.gif' width=9 border=0></TD></TR><TR><TD width=9 background=../images/tbllm1.gif><IMG src='../images/tblo.gif'></TD><TD>");}
function createTableClose_withshade(){document.write("</TD><TD background=../images/tblrm1.gif><IMG src='../images/tblo.gif'></TD></TR><TR><TD><IMG height=10 alt='' src='../images/tbllb1.gif' width=9 border=0></TD><TD valign=bottom width=9 background=../images/tblb1.gif><IMG alt='' src='../images/tblo.gif' border=0></TD><TD><IMG height=10 alt='' src='../images/tblrb1.gif' width=9 border=0></TD></TR></TABLE>");}
var w3c=(document.getElementById)?true:false;
var ie=(document.all)?true:false;
var N=-1;	
function createBar(w,h,bgc,brdW,brdC,blkC,speed,blocks,count,action){
	if(ie||w3c){
		var t='<div id="_xpbar'+(++N)+'" style="visibility:visible; position:relative; overflow:hidden; width:'+w+'px; height:'+h+'px; background-color:'+bgc+'; border-color:'+brdC+'; border-width:'+brdW+'px; border-style:solid; font-size:1px;">';
		t+='<span id="blocks'+N+'" style="left:-'+(h*2+1)+'px; position:absolute; font-size:1px">';
		for(i=0;i<blocks;i++){
			t+='<span style="background-color:'+blkC+'; left:-'+((h*i)+i)+'px; font-size:1px; position:absolute; width:'+h+'px; height:'+h+'px; '
			t+=(ie)?'filter:alpha(opacity='+(100-i*(100/blocks))+')':'-Moz-opacity:'+((100-i*(100/blocks))/100);
			t+='"></span>';
		}
		t+='</span></div>';
		document.write(t);
		var bA=(ie)?document.all['blocks'+N]:document.getElementById('blocks'+N);
		bA.bar=(ie)?document.all['_xpbar'+N]:document.getElementById('_xpbar'+N);
		bA.blocks=blocks; bA.N=N; bA.w=w; bA.h=h; bA.speed=speed; bA.ctr=0; bA.count=count;
		bA.action=action;
		/*bA.togglePause=togglePause;*/
		bA.showBar=function(){this.bar.style.visibility="visible";}
		bA.hideBar=function(){this.bar.style.visibility="hidden";}
		bA.tid=setInterval('startBar('+N+')',speed);
		return bA;
	}
}
function startBar(bn){
	var t=(ie)?document.all['blocks'+bn]:document.getElementById('blocks'+bn);
	if(parseInt(t.style.left)+t.h+1-(t.blocks*t.h+t.blocks)>t.w){
		t.style.left=-(t.h*2+1)+'px'; t.ctr++;
		if(t.ctr>=t.count){eval(t.action);t.ctr=0;}
	}else t.style.left=(parseInt(t.style.left)+t.h+1)+'px';
}
// var xyz = createBar(total_width,total_height,background_color,border_width,border_color,block_color,scroll_speed,block_count,scroll_count,action_to_perform_after_scrolled_n_times)
/* var bar1= createBar(90,20,'white',1,'black','orange',85,7,3,"");*/
