<!--
	function chk_rad(t, n, msg) {
		for (var i=0; i<n; i++) {
			if (t[i].checked!="0") return true;
		}
		alert(msg);
		return false;
	}
   
	function chk_text(t, msg) {
		if (t.value != '') return true;
		alert(msg);
		t.focus();
		return false;
	}
	
	function chk_select(t, msg) {
		if (t.selectedIndex != 0) return true;
       	alert(msg);
		t.focus();
		return false;
	}
	
	function chk_text_email(t, msg) {
      if (t.value != '') {
        var at = t.value.indexOf('@', 0);
        if (at > 1 && t.value.lastIndexOf('.') > at) {
           return true;
        }
       }
       alert(msg);
       t.focus();
       t.select();
       return false;
   }
   
   function chk_textPassword(t, s, msg) {
		if(s.value == t.value) return true;
		alert(msg);
		s.focus();
		return false;
	}
	
	function chk_number(t, msg){
		var valid = "0123456789";
		var tt = t.value;
		for (var i=0; i < tt.length; i++) {
			temp = "" + tt.substring(i, i+1);
			if (valid.indexOf(temp) == "-1"){
				alert(msg);
				t.focus();
				return false;	
			}
		}	
		return true;
	}
	
	function chk_NumofChar(t, msg, num){
		if(t.value.length > num) return true;
		alert(msg);
		t.focus();
		return false;
	}
	
	function OnKeyPressForTest(){
  		// to allow 0-9 numeric digit in the input field
  		if( event.keyCode < 48 || event.keyCode > 57 ) event.returnValue = false;
	}
	
	function alertmsg(tclick, url){
		var a = confirm("Are you sure you want to "+tclick+" this ticket?", "Yes", "No")
		if (a == true) {
			window.location.href = url;
		}
	}
	
	function alertmsg2(msg, url){
		var a = confirm(msg, "Yes", "No")
		if (a == true) {
			window.location.href = url;
		}
	}
	
	function popWin(Page,Title,scrbar,w,h) {
	
		LPos = (screen.width - w)/2;
		TPos = (screen.height - h)/2;
	
		window.open(Page,Title,"height="+h+",width="+w+",scrollbars="+scrbar+",resizable=no,maximize=no,left="+LPos+", top="+TPos);
	
	}
	
	function MM_callJS(jsStr) { //v2.0
  		return eval(jsStr)
	}
   
   function sendIt(fileName) {
      //If the selected file name isn't blank, send it to reader.
      if (fileName != "") {
         location.href=fileName
      }
   	}
   	
   	function sendIt2(fileName) {
      //If the selected file name isn't blank, send it to reader.
      if (fileName != "") {
         //parent.location.href=fileName
         window.open(fileName);
      }
   	}
   	
   	function jump2order(fileName, num, url) {
      //If the selected file name isn't blank, send it to reader.
      if (fileName != "") {
      	if (fileName == num) {
        	location.href=url
        }
      }
   	}
   	
   	function jump2(fileName, url) {
      //If the selected file name isn't blank, send it to reader.
      if (fileName != "") {
      	//if (fileName == num) {
        location.href=url
        //}
      }
   	}
   	
   	//Function to open preview post window
	function OpenPreviewWindow(targetPage, formName){
		
		now = new Date  
		
		//Open the window first 	
	   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   		
	   	//Now submit form to the new window
	   	formName.action = targetPage + "?ID=" + now.getTime();	
		formName.target = "preview";
		formName.submit();
	}
   
   	function OpenURL(URL, Title){
   		window.open(URL, Title);
   	}
   	
   	function OpenURL2(URL){
   		window.location.href= URL
   	}
   
   function DateAdd(startDate, numDays, numMonths, numYears){
		var returnDate = new Date(startDate.getTime());
		var yearsToAdd = numYears;
	
		var month = returnDate.getMonth()	+ numMonths;
		if (month > 11)
		{
			yearsToAdd = Math.floor((month+1)/12);
			month -= 12*yearsToAdd;
			yearsToAdd += numYears;
		}
		returnDate.setMonth(month);
		returnDate.setFullYear(returnDate.getFullYear()	+ yearsToAdd);
	
		returnDate.setTime(returnDate.getTime()+60000*60*24*numDays);
	
		return returnDate;
	
	}

	var marked_row = new Array;


	function toggleDisplay(id){
		
		if(this.document.getElementById( id).style.display=='none'){
			this.document.getElementById( id).style.display=''
			if(this.document.getElementById(id+"link") != undefined){
				this.document.getElementById(id+"link").style.display='none';
			}
						
		}else{
			this.document.getElementById(  id).style.display='none'
			if(this.document.getElementById(id+"link") != undefined){
				this.document.getElementById(id+"link").style.display='';
			}
		}
	}

	function toDecimal(original){
		temp = Math.round(original*100)/100;
		if((original * 100) % 100 == 0)
			return temp + '.00';
		if((original * 10) % 10 == 0)
			return temp + '0';
		return temp
	}
	
	function isInteger(s){
		var i;
	    for (i = 0; i < s.length; i++){
	        // Check that current character is number.
	        var c = s.charAt(i);
	        if (((c < "0") || (c > "9"))) return false;
	    }
	    // All characters are numbers.
	    return true;
	}
	
	function isNumeric(s){
	  if(!/^-*[0-9\.]+$/.test(s))
	   {
	   		return false
	   }
	   else
	   {
	   		return true;
	   }
	}
	
	function stripCharsInBag(s, bag){
		var i;
	    var returnString = "";
	    // Search through string's characters one by one.
	    // If character is not in bag, append to returnString.
	    for (i = 0; i < s.length; i++){
	        var c = s.charAt(i);
	        if (bag.indexOf(c) == -1) returnString += c;
	    }
	    return returnString;
	}
	
	function isValidEmail(emailStr){
		if(emailStr.length== 0){
			return true;
		}
		if(!/^\w+([\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(emailStr))
			return false
		return true	
	}
	
	function isValidPhone(phoneStr){
		if(phoneStr.length== 0){
			return true;
		}
		if(!/^[0-9\-\(\)]+$/.test(phoneStr))
			return false
		return true	
	}
	
	function goToUrl(selObj, goToLocation){
	    eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'");
	}
	

/**
 * This array is used to remember mark status of rows in browse mode
 */
var marked_row = new Array;

/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 Current color is the marker one
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

/*
 * Sets/unsets the pointer and marker in vertical browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 *
 * @author Garvin Hicking <me@supergarv.de> (rewrite of setPointer.)
 */
function setVerticalPointer(theRow, theRowNum, theAction, theDefaultColor1, theDefaultColor2, thePointerColor, theMarkColor) {
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;

    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        domDetect    = false;
    } // end 3

    var c = null;
    // 5.1 ... with DOM compatible browsers except Opera
    for (c = 0; c < rowCellsCnt; c++) {
        if (domDetect) {
            currentColor = theCells[c].getAttribute('bgcolor');
        } else {
            currentColor = theCells[c].style.backgroundColor;
        }

        // 4. Defines the new color
        // 4.1 Current color is the default one
        if (currentColor == ''
            || currentColor.toLowerCase() == theDefaultColor1.toLowerCase() 
            || currentColor.toLowerCase() == theDefaultColor2.toLowerCase()) {
            if (theAction == 'over' && thePointerColor != '') {
                newColor              = thePointerColor;
            } else if (theAction == 'click' && theMarkColor != '') {
                newColor              = theMarkColor;
                marked_row[theRowNum] = true;
            }
        }
        // 4.1.2 Current color is the pointer one
        else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
                 && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
            if (theAction == 'out') {
                if (c % 2) {
                    newColor              = theDefaultColor1;
                } else {
                    newColor              = theDefaultColor2;
                }
            }
            else if (theAction == 'click' && theMarkColor != '') {
                newColor              = theMarkColor;
                marked_row[theRowNum] = true;
            }
        }
        // 4.1.3 Current color is the marker one
        else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
            if (theAction == 'click') {
                newColor              = (thePointerColor != '')
                                      ? thePointerColor
                                      : ((c % 2) ? theDefaultColor1 : theDefaultColor2);
                marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                      ? true
                                      : null;
            }
        } // end 4

        // 5. Sets the new color...
        if (newColor) {
            if (domDetect) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            }
            // 5.2 ... with other browsers
            else {
                theCells[c].style.backgroundColor = newColor;
            }
        } // end 5
    } // end for

     return true;
 } // end of the 'setVerticalPointer()' function

/**
 * Checks/unchecks all tables
 *
 * @param   string   the form name
 * @param   boolean  whether to check or to uncheck the element
 *
 * @return  boolean  always true
 */



	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];}}
	}
	
	function MM_swapImgRestore() { //v3.0
	  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}
	
	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}
	
	function MM_swapImage() { //v3.0
	  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
	}
	
	
	/* Browser check */
IS_DOM = (document.getElementById) ? true : false;
IS_IE = (document.all) ? true : false;
IS_IE50 = (navigator.userAgent.indexOf("IE 5.0") != -1);
IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);

// Image Swapping
function changeImages() 
{
  if (document.getElementById) {
    for (var i = 0; i < changeImages.arguments.length; i += 2) { 
  		document.getElementById(changeImages.arguments[i]).src = eval(changeImages.arguments[i + 1] + ".src"); 
	}
  }
}

// Get an ID 
function getThis(sId)
{
	var oObject;
	oObject = false;
	
	if (IS_DOM) {
		if (document.getElementById(sId)) {
			oObject = document.getElementById(sId);
		}
	}
	
	return oObject;
}
	
//-->