function PopUp(theURL,winName,features) {
	window.open(theURL,winName,features);
}

function ShowTooltip(fArg)
			{
				var tooltipOBJ = eval("document.all['tt" + fArg + "']");
				var testTop = (document.body.scrollTop + event.clientY) + 15;
				var testLeft = event.clientX - 0;
				var tooltipAbsLft = (testLeft < 0) ? 10 : testLeft;
				var tooltipAbsTop = (testTop < document.body.scrollTop) ? document.body.scrollTop + 10 : testTop;
				tooltipOBJ.style.posLeft = tooltipAbsLft;
				tooltipOBJ.style.posTop = tooltipAbsTop;
				tooltipOBJ.style.visibility = "visible";
			}
			/*=================================================================
			Function: HideTooltip
			Purpose:  set visibility attribute of tooltip to hidden
			Input:    none
			Returns:  undefined
			==================================================================*/
			function HideTooltip(fArg)
			{
				var tooltipOBJ = eval("document.all['tt" + fArg + "']");
				tooltipOBJ.style.visibility = "hidden";
			}

function right(e) {
	
	var msg = "This image is copyright protected";
	
	if (navigator.appName == 'Netscape' && e.which == 3) {
		alert(msg);
		return false;
	}
	
	if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
		alert(msg);
		return false;
	}
	else return true;
}

var runfirst = []; // array of functions to call on page onload event

function initpage() {
	
	if (document.images) {
		// copyright message on images
		for (i = 0; i < document.images.length; i++) {
			document.images[i].onmousedown = right;
			document.images[i].oncontextmenu = new Function("return false;")
		}
	}
	
	noSelect(); // disable selection
	
	for (i = 0; i < runfirst.length; i++) {
		//alert(runfirst[i]);
		runfirst[i]();
	}
	
	try {
		initDropDown();
	} catch (e) {}
	
	try {
		initDropDown2();
	} catch (e) {}
	
	try {
		pageInit();
	} catch (e) {}
}

/***********************************************
* Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
* Modified here to exclude form tags properly and cross browser by jscheuer1
***********************************************/

var omitformtags = ["input", "textarea", "select"]

function disableselect(e){
	for (i = 0; i < omitformtags.length; i++) {
		if (omitformtags[i]==(e.target.tagName.toLowerCase()))
			return;
	}
	
	return false
}

function reEnable() {
	return true
}

function noSelect(){
	
	if (typeof document.onselectstart!="undefined"){
		
		document.onselectstart = new Function ("return false")
		
		if (document.getElementsByTagName){
			
			tags = document.getElementsByTagName('*')
			
			for (j = 0; j < tags.length; j++){
				for (i = 0; i < omitformtags.length; i++) {
					
					if (tags[j].tagName.toLowerCase() == omitformtags[i]) {
						
						tags[j].onselectstart=function(){
							document.onselectstart=new Function ('return true')
						}
						
						tags[j].onmouseup=function(){
							document.onselectstart=new Function ('return false')
						}
					}
				}
			}
		}
	} else{
		document.onmousedown = disableselect
		document.onmouseup = reEnable
	}
}

/**
 * jQuery.labelify - Display in-textbox hints
 * Stuart Langridge, http://www.kryogenix.org/
 * Released into the public domain
 * Date: 25th June 2008
 * @author Stuart Langridge
 * @version 1.3
 *
 *
 * Basic calling syntax: $("input").labelify();
 * Defaults to taking the in-field label from the field's title attribute
 *
 * You can also pass an options object with the following keys:
 *   text
 *     "title" to get the in-field label from the field's title attribute 
 *      (this is the default)
 *     "label" to get the in-field label from the inner text of the field's label
 *      (note that the label must be attached to the field with for="fieldid")
 *     a function which takes one parameter, the input field, and returns
 *      whatever text it likes
 *
 *   labelledClass
 *     a class that will be applied to the input field when it contains the
 *      label and removed when it contains user input. Defaults to blank.
 *  
 */
jQuery.fn.labelify = function(settings) {
  settings = jQuery.extend({
    text: "title",
    labelledClass: ""
  }, settings);
  var lookups = {
    title: function(input) {
      return $(input).attr("title");
    },
    label: function(input) {
      return $("label[for=" + input.id +"]").text();
    }
  };
  var lookup;
  var jQuery_labellified_elements = $(this);
  return $(this).each(function() {
    if (typeof settings.text === "string") {
      lookup = lookups[settings.text]; // what if not there?
    } else {
      lookup = settings.text; // what if not a fn?
    };
    // bail if lookup isn't a function or if it returns undefined
    if (typeof lookup !== "function") { return; }
    var lookupval = lookup(this);
    if (!lookupval) { return; }

    // need to strip newlines because the browser strips them
    // if you set textbox.value to a string containing them    
    $(this).data("label",lookup(this).replace(/\n/g,''));
    $(this).focus(function() {
      if (this.value === $(this).data("label")) {
        this.value = this.defaultValue;
        $(this).removeClass(settings.labelledClass);
      }
    }).blur(function(){
      if (this.value === this.defaultValue) {
        this.value = $(this).data("label");
        $(this).addClass(settings.labelledClass);
      }
    });
    
    var removeValuesOnExit = function() {
      jQuery_labellified_elements.each(function(){
        if (this.value === $(this).data("label")) {
          this.value = this.defaultValue;
          $(this).removeClass(settings.labelledClass);
        }
      })
    };
    
    $(this).parents("form").submit(removeValuesOnExit);
    $(window).unload(removeValuesOnExit);
    
    if (this.value !== this.defaultValue) {
      // user already started typing; don't overwrite their work!
      return;
    }
    // actually set the value
    this.value = $(this).data("label");
    $(this).addClass(settings.labelledClass);

  });
};
