<!--
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];}
}

function openWin(target){
	child = window.open(target);
	child.focus();
}
function openPopup(page,width,height) {
        var loc = page;
        var windowWidth=350;
        if(width)
            windowWidth=width;
        var windowHeight=350;
        if(height)
            windowHeight=height;
        window.open(loc, "Various", "status=0,toolbar=0,location=0,scrollbars=1,width="+windowWidth+",height="+windowHeight+"");
}
function getkey(e)
{
	if (window.event)
		return window.event.keyCode;
	else if (e)
		return e.which;
	else
		return null;
}

function suppress(e)
{
	var key, keychar;
	key = getkey(e);
	//alert("key: " + key);
	if (key==13)
		return false;
}
function SetBlockVisibility(elementId)
{
	//shows/hide the container
	var itemBlock = document.getElementById(eval(elementId));
	if(itemBlock!=null)
	{
		itemBlock.style.display=(itemBlock.style.display == 'none' ? 'block' : 'none');
	}
}
function trim(stringToTrim) {
    return stringToTrim.replace(/^\s+|\s+$/g,"");
} 

function LimitMaxlength(obj,mlength)
{
    if (mlength>0 && obj.getAttribute && obj.value.length>mlength-1)
    obj.value=obj.value.substring(0,mlength-1) //start, end index
}

function showElement(id)
{
    if(id)
    	document.getElementById(id).style.display='block';
}

function hideElement(id)
{
    if(id)
    	document.getElementById(id).style.display='none';
}

/*for onclick input field text switch*/
function SwitchText(elem, val) {
    elem.style.color = '#dddddd';
    elem.value = val;
                        
    elem.onfocus = function () {
        if (this.value == val) {
            //this.style.color = '';
            this.value = ''; //On focus, make blank
        }
    }
    elem.onblur = function () {
        if (this.value == '') {
            this.value = val; //If it's not in focus, use declared value
        }
    }
}

/*greybox uses start*/
GB_myWindow = function(caption, url, /* optional */ height, width, callback_fn) {
    var options = {
    caption: caption,
    height: height || 500,
    width: width || 500,
    fullscreen: false,
    overlay_click_close: true,
    show_loading: true,
    callback_fn: callback_fn,
    center_win:true
    }
    var win = new GB_Window(options);
    return win.show(url);
}       


GB_myPicture = function(caption, url, /* optional */ height, width, callback_fn) {
    var options = {
        caption: caption,
        height: height || 300,
        width: width || 300,
        fullscreen: false,
        overlay_click_close: true,
        show_loading: true,
        callback_fn: callback_fn,
        center_win:true,
        type:"image"
    }
    var win = new GB_Window(options);
    return win.show(url);
}
/*end greybox uses*/

//-->


