function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// numbers only 
function InputOnlyNumbers(box)
{
if (isNaN($(box).value))
{ alert("This should be number only."); } 
}
//numbers only


// check if the fist value is greater then 2nd value.
function CheckValuesGreater1 (no1, no2)
{
	value1 = $(no1).value;
	value2 = $(no2).value;
	
	if (value1 > value2)
		{ alert ("Capactiy starting value cannot be greater then Capacity ending value."); 
			$(no2).value = '';
		}
		
	
}

// check file field validition
function UploadValidate(idfile)
{
if($(idfile).value == '')
	{
		alert('Please Browse for the image');
		$(idfile).focus();
		return false;
	}
	return true;
}
//


// count characters and give warning
function a_countcharmaxleng(forwhat, maxvalue, showwhere)
{
	var forwhat;
var inp = $(forwhat).value;
var l = parseInt(inp.length)
if (l > maxvalue){
    alert("You reached the maximum number of characters !!!!")
		inp = inp.substr(0,maxvalue+1)
		$(forwhat).value = inp
		return;
		}
		
	$(showwhere).innerHTML=inp.length;
}
// count characters and give warning


// hide the ID



// cookies
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);
}
// cookies


// Sub Menu Script

startList = function() {

if (document.all&&document.getElementById) {

navRoot = document.getElementById("topnav");

for (i=0; i<navRoot.childNodes.length; i++) {

node = navRoot.childNodes[i];

if (node.nodeName=="LI") {

node.onmouseover=function() {

this.className+=" over";

  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;
//document.getElementById('errormsg').style.display = "none";

// Sub Menu Script

// login error messages
function undialogpop(box){document.getElementById(box).style.display = "none";}

function dialogpop(box){
document.getElementById(box).style.display = "block";
}
function dialogpopd(box){return(dialogpop(box));}
// login error messages



// my own lightbox kind
function hide () {for (i = 0; i < arguments.length; i++) {var e = $(arguments[i]); if (e) e.style.display = "none";}}
function show () {for (i = 0; i < arguments.length; i++) {var e = $(arguments[i]); if (e) e.style.display = "";}}

function my_lightbox() {

offset = window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;

      $('lightbox-cover').style.top = offset + 'px';
				
      $('lightbox-popup').style.top = 20 + offset + '%';
				
			show("lightbox-cover", "lightbox-popup");

        return;
}

// ajax print
var gAutoPrint = true; // Flag for whether or not to automatically call the print function
function printSpecial(addlogo)
{
	if (document.getElementById != null)
	{
		var html = '';
		if (document.getElementsByTagName != null)
		{
			//var headTags = document.getElementsByTagName("head");
			//if (headTags.length > 0)
				//html += headTags[0].innerHTML;
		}
		
		if (addlogo == 'yes')
		{
		html += '<img src=\"../images/logo_small.gif">\n'
		html += '<hr />\n'
		}
		
		
	var printReadyElem = document.getElementById("printReady");
		//var heads		   = document.getElementById("heads");
		//var remlnks		   = document.getElementById("removelinks");
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}
function flvFPW1(){//v1.44
// Copyright 2002-2004, Marja Ribbers-de Vroed, FlevOOware (www.flevooware.nl/dreamweaver/)
var v1=arguments,v2=v1[2].split(","),v3=(v1.length>3)?v1[3]:false,v4=(v1.length>4)?parseInt(v1[4]):0,v5=(v1.length>5)?parseInt(v1[5]):0,v6,v7=0,v8,v9,v10,v11,v12,v13,v14,v15,v16;v11=new Array("width,left,"+v4,"height,top,"+v5);for (i=0;i<v11.length;i++){v12=v11[i].split(",");l_iTarget=parseInt(v12[2]);if (l_iTarget>1||v1[2].indexOf("%")>-1){v13=eval("screen."+v12[0]);for (v6=0;v6<v2.length;v6++){v10=v2[v6].split("=");if (v10[0]==v12[0]){v14=parseInt(v10[1]);if (v10[1].indexOf("%")>-1){v14=(v14/100)*v13;v2[v6]=v12[0]+"="+v14;}}if (v10[0]==v12[1]){v16=parseInt(v10[1]);v15=v6;}}if (l_iTarget==2){v7=(v13-v14)/2;v15=v2.length;}else if (l_iTarget==3){v7=v13-v14-v16;}v2[v15]=v12[1]+"="+v7;}}v8=v2.join(",");v9=window.open(v1[0],v1[1],v8);if (v3){v9.focus();}document.MM_returnValue=false;return v9;}
// for the browser crome popup