<!--//

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_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_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 closewindow_findObj(n, d) {
  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.sublimes&&i<d.sublimes.length;i++) x=closewindow_findObj(n,d.sublimes[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function closewindow_Cascadingsublimes() {

  var i,p,v,obj,args=closewindow_Cascadingsublimes.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=closewindow_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function closewindow_findObj(n, d) {
  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.sublimes&&i<d.sublimes.length;i++) x=closewindow_findObj(n,d.sublimes[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function closewindow_Cascadingsublimes() {

  var i,p,v,obj,args=closewindow_Cascadingsublimes.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=closewindow_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function closewindow_findObj(n, d) {
  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.sublimes&&i<d.sublimes.length;i++) x=closewindow_findObj(n,d.sublimes[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function closewindow_Cascadingsublimes() {

  var i,p,v,obj,args=closewindow_Cascadingsublimes.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=closewindow_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function showMenu(imgId,cNo, addValue)
{

	var cellposx = document.getElementById(imgId).offsetParent.offsetLeft;
	var tableposx = document.getElementById(imgId).offsetParent.offsetParent.offsetLeft;
	var lpos =cellposx + tableposx + addValue;
	switch (cNo)
	{
		case 1:
			var d=document.getElementById('qhi0');
			d.style.left=lpos;
			closewindow_Cascadingsublimes('qhi0','','show','qhi1','','hide','qhi2','','hide');
			break;			
		case 2:
			var d=document.getElementById('qhi1');
			d.style.left=lpos;		
			closewindow_Cascadingsublimes('qhi1','','show');
			break;
		case 3:			
			var d=document.getElementById('qhi2');
			d.style.left=lpos;		
			closewindow_Cascadingsublimes('qhi2','','show');		
			break;
		case 4:			
			var d=document.getElementById('qhi3');
			d.style.left=lpos;		
			closewindow_Cascadingsublimes('qhi3','','show');		
			break;
		case 5:			
			var d=document.getElementById('qhi4');
			d.style.left=lpos;		
			closewindow_Cascadingsublimes('qhi4','','show');		
			break;
	}
}

/******************************************
* Popup Box- By Jim Silver @ jimsilver47@yahoo.com
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

var ns4=document.layers
var ie4=document.all
var ns6=document.getElementById&&!document.all

//drag drop function for NS 4////
/////////////////////////////////

var dragswitch=0
var nsx
var nsy
var nstemp

function drag_dropns(name){
if (!ns4)
return
temp=eval(name)
temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
temp.onmousedown=gons
temp.onmousemove=dragns
temp.onmouseup=stopns
}

function gons(e){
temp.captureEvents(Event.MOUSEMOVE)
nsx=e.x
nsy=e.y
}
function dragns(e){
if (dragswitch==1){
temp.moveBy(e.x-nsx,e.y-nsy)
return false
}
}

function stopns(){
temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for ie4+ and NS6////
/////////////////////////////////


function drag_drop(e){
if (ie4&&dragapproved){
crossobj.style.left=tempx+event.clientX-offsetx
crossobj.style.top=tempy+event.clientY-offsety
return false
}
else if (ns6&&dragapproved){
crossobj.style.left=tempx+e.clientX-offsetx+"px"
crossobj.style.top=tempy+e.clientY-offsety+"px"
return false
}
}

function initializedrag(e){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
firedobj=ns6? firedobj.parentNode : firedobj.parentElement
}

if (firedobj.id=="dragbar"){
offsetx=ie4? event.clientX : e.clientX
offsety=ie4? event.clientY : e.clientY

tempx=parseInt(crossobj.style.left)
tempy=parseInt(crossobj.style.top)

dragapproved=true
document.onmousemove=drag_drop
}
}
document.onmouseup=new Function("dragapproved=false")

////drag drop functions end here//////

function hidebox(){
crossobj=ns6? document.getElementById("showimage") : document.all.showimage
if (ie4||ns6)
crossobj.style.visibility="hidden"
else if (ns4)
document.showimage.visibility="hide"
}

function isBlank(value)
	{
		var res = true;		
		var l = value.length;		
		for(var i = 0; i < l; i++)
		{
			if (value.charAt(i) != " ")
			{
				res = false;
				break;
			}
		}
		
		return res;
	}
	
	function isNumeric(value, allowZeroStart)
	{
		
		if (allowZeroStart)
		{
			return (/^[0-9]+$/.test(value));
		}
		else
		{
			return (/^[1-9]+[0-9]*$/.test(value));
		}			
	}	
//-->