//<![CDATA[
		   

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  UTILITY FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function setDivHeight(divID,theHeight){
	var theHeightPx = theHeight + "px"
	document.getElementById(divID).style.height=theHeightPx;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Removes leading whitespaces
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Removes special characters
function replaceSpecialCharacters( value ) {
	value = value.replace('"', '');
	value = value.replace('&', 'and');
	value = value.replace("'", "");
	return escape(value);
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function validateEmail(v){
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(v)){
		return true;
	} else {
		return false;
	}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function getParentWinHeight() {
	var winH = 460;

	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winH = window.innerHeight-16;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winH = document.body.offsetHeight-20;
	 }
	}
	return winH;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function getParentWinWidth() {
	var winW = 630

	if (parseInt(navigator.appVersion)>3) {
	 if (navigator.appName=="Netscape") {
	  winW = window.innerWidth-16;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth-20;
	 }
	}	
	return winW;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// toggle visibility 
function toggle( theTarget ){ 
  if (document.getElementById){ 
        target = document.getElementById( theTarget ); 
           if (target.style.display == "none"){ 
              target.style.display = "";
           } else { 
              target.style.display = "none"; 
           }
     } 
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function setGlobalNextFunction(nextFunction) {
	if(nextFunction != undefined){
		var n = nextFunction;
		createCookie('CotChalkNextFunction',n);
		
	} else {//dump cookie
		if( readCookie('CotChalkNextFunction') != null ){
			eraseCookie('CotChalkNextFunction');}
	}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function printDiv(theDiv){     
	w = window.open('', 'printPopup');
	w.document.open();
	
	element = document.getElementById(theDiv);
	
	w.document.write(element.innerHTML);
	w.print();
	w.document.close();
	w.close();
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function jsrot13(text) {
	var rot13text_rotated = ""; /* the function will return this string */;
	for (i = 1 ; i < (text.length + 1); i++) {
		k = text.charCodeAt(i-1);
		if (k >= 97 && k <= 109) {
		k = k + 13;
		} else
		if (k >= 110 && k <= 122) {
		k = k - 13;
		} else
		if (k >= 65 && k <= 77) {
		k = k + 13;
		} else
		if (k >= 78 && k <= 90) {
		k = k - 13;
	}
	rot13text_rotated = rot13text_rotated + String.fromCharCode(k);
	}
	return rot13text_rotated;
	//return text;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function jsrot47(data){
	var res = "";

	for(var i = 0; i < data.length; i++){
		var ch = data.charCodeAt(i);
		res += (ch + 47 >= 126) ? String.fromCharCode(" ".charCodeAt(0) + (ch + 47) % 126) : String.fromCharCode(ch + 47);
	}
	return res;
	//return data;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++







//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  AJAX FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function iLoveAjax(theElement,theURL,nextFunction) {
	var XMLHttpRequestObject=false;

	//set temp_theURL; add the pseudoParam to theURL so that the url doesn't cache
	var checkForQuestionMarkInURL=theURL.indexOf('?'); //check for '?'
	if (checkForQuestionMarkInURL < 0){  // question mark=F
		var temp_theURL=theURL+'?pseudoParam='+new Date().getTime();
	} else {  // question mark=T
		var temp_theURL=theURL+'&pseudoParam='+new Date().getTime();
	}
	
	if (window.XMLHttpRequest) {
		XMLHttpRequestObject = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHttp");
	}
	
	if(XMLHttpRequestObject) {
		XMLHttpRequestObject.open("GET", temp_theURL);
		XMLHttpRequestObject.onreadystatechange = function() {
		if(XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
			if(theElement != 'none' && theElement != undefined){
				document.getElementById(theElement).innerHTML = XMLHttpRequestObject.responseText;
			}
			delete XMLHttpRequestObject;
			XMLHttpRequestObject = null;
			if (nextFunction != undefined){setTimeout(nextFunction,500);}

			}
		}
		
	XMLHttpRequestObject.send(null);
	}
}





//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  COOKIE FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function eraseCookie(name) {
	createCookie(name,"",-1);
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  FLASH MOVIE FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function MM_CheckFlashVersion(reqVerStr,msg){
 with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}













//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//  DREAMWEAVER STANDARD FUNCTIONS
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}







//]]>
