
var disable_right_click;
var message;

if( disable_right_click ){
	
	function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById && !document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
	
}
 
function parseSearchString(){
	var pairs=unescape(location.search.substring(1).replace(/\+/g," ")).split('&');
	for (var i=0;i<pairs.length;i++){
		var pair = pairs[i].split('=');
		this[pair[0]]=pair[1];
	}
}
 
function increaseTextareaHeight(el, add) {

	if(document.getElementById){
    	theElement = document.getElementById(el);
    }else if(document.all){
    	theElement = document.all.el;
	}
	
	newHeight = parseInt(theElement.style.height) + parseInt(add);
	theElement.style.height = newHeight + "px";
	
}

function decreaseTextareaHeight(el, subtract) {
	
	if(document.getElementById){
    	theElement = document.getElementById(el);
    }else if(document.all){
    	theElement = document.all.el;
	}
	
	if((parseInt(theElement.style.height) - subtract) > 100) {
		newHeight = parseInt(theElement.style.height) - parseInt(subtract);
		theElement.style.height = newHeight + "px";
	}else {
		newHeight = 100;
		theElement.style.height = "100px";
	}			
}


function increaseTextareaWidth(el, add) {

	if(document.getElementById){
    	theElement = document.getElementById(el);
    }else if(document.all){
    	theElement = document.all.el;
	}
	
	newWidth = parseInt(theElement.style.width) + parseInt(add);
	theElement.style.width = newWidth + "px";
	
}

function decreaseTextareaWidth(el, subtract) {
	
	if(document.getElementById){
    	theElement = document.getElementById(el);
    }else if(document.all){
    	theElement = document.all.el;
	}
	
	if((parseInt(theElement.style.width) - subtract) > 200) {
		newWidth = parseInt(theElement.style.width) - parseInt(subtract);
		theElement.style.width = newWidth + "px";
	}else {
		newWidth = 200;
		theElement.style.width = "200px";
	}			
}



function WindowBookmark(url, title) {
	window.external.AddFavorite(url,title);
}
 
  
function changeImage(imageName,imagePath){
	if(document.images){
  		document[imageName].src=imagePath;
	}
}

function selectAll(formObj, isInverse, type) {
   for (var i=0;i < formObj.length;i++) {
      fldObj = formObj.elements[i];
      if (fldObj.type == type){ 
         if(isInverse)
            fldObj.checked = (fldObj.checked) ? false : true;
         else fldObj.checked = true; 
       }
   }
}


function openWin(path,theHeight,theWidth,theLeft,theTop,TOOLBAR,LOCATION,DIRECT,STATUS,MENUBAR,SCROLL,RESIZE){
	var MyWindow;
	var features='toolbar='+TOOLBAR+',';
	features+='location='+LOCATION+',';
	features+='directories='+DIRECT+',';
	features+='status='+STATUS+',';
	features+='menubar='+MENUBAR+',';
	features+='scrollbars='+SCROLL+',';
	features+='resizable='+RESIZE+',';
	features+='width='+theWidth+',height='+theHeight+',left='+theLeft+',top='+theTop;

	MyWindow=window.open(path,'MyWindow',features);
}

function closeAlert() {
	window.setTimeout("window.close()",10000);
	return false;
}



function hide(el){
    if(document.getElementById){
    	document.getElementById(el).style.display = 'none';
    }else if(document.all){
    
    	document.all.el.style.display = 'none';
	}
}

function show(el){
	if(document.getElementById){
		document.getElementById(el).style.display = 'inline'
	}else if(document.all){
		document.all.el.style.display = 'inline'
	}
}

function tog(el){
	if(document.getElementById){
		if(document.getElementById(el).style.display == 'inline'){
			hide(el);
		}else{
			show(el);
		}
	}else if(document.all){
		if(document.all.el.style.display = 'inline'){
			hide(el);
		}else{
			show(el);
		}		
	}
}


function ShowObject(object){
	if (document.getElementById) {
		document.getElementById(object).style.visibility = 'visible';
	} else if (document.layers && document.layers[object]) {
		document.layers[object].visibility = 'visible';
	} else if (document.all) {
		document.all[object].style.visibility = 'visible';
	}

}

function HideObject(object) {
	if (document.getElementById) {
		document.getElementById(object).style.visibility = 'hidden';
	} else if (document.layers && document.layers[object]) {
		document.layers[object].visibility = 'hidden';
	} else if (document.all) {
		document.all[object].style.visibility = 'hidden';
	}

}

 
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}

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 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;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);


function validRequired(formField,fieldLabel){
	var result = true;
	
	if (formField.value == "")
	{
		alert('Please enter a value for the "' + fieldLabel+'"');
		formField.focus();
		result = false;
	}
	
	return result;
}



function disableForm(theform) {
	if (document.all || document.getElementById) {
		
		for (i = 0; i < theform.length; i++) {
			
			var tempobj = theform.elements[i];
			if (tempobj.type.toLowerCase() == "submit" || tempobj.type.toLowerCase() == "reset")
			tempobj.disabled = true;
		}
		return true;
		
	}else {
		return false;	
   }
   
}