function manipulateSelects(show) {
	for (var i = 0; i<document.forms[0].elements.length; i++) {
		if (document.forms[0].elements[i].type == 'select-one') {
			document.forms[0].elements[i].style.visibility = show;
		}
	}
}

/*
2) Your anchor tag MUST contain both NAME and ID attributes which are the 
   same. For example:
   <A NAME="test" ID="test"> </A>

*/ 
// getAnchorPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the page.
function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		//fix for netscape 7 works fine in ver 6 too
		//		x=o.offsetLeft;
		//		y=o.offsetTop;
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

function $id(id) {
	return document.getElementById(id);
}
function updateInnerHTML(obj, id, str) {
	$id(id).innerHTML = str;
}
function addClassName(obj, id, strClassName){
	var strCurrentClass = $id(id).className;
	if(!new RegExp(strClassName, "i").test(strCurrentClass)){
		$id(id).className = strCurrentClass + ((strCurrentClass.length > 0)? " " : "") + strClassName;
	}
}
function removeClassName(obj, id, strClassName){
	var oClassToRemove = new RegExp((strClassName + "\s?"), "i");
	$id(id).className = $id(id).className.replace(oClassToRemove, "").replace(/^\s?|\s?$/g, "");
}


function DL_GetElementLeft(eElement)
{
   if (!eElement && this)                    // if argument is invalid
   {                                         // (not specified, is null or is 0)
      eElement = this;                       // and function is a method
   }                                         // identify the element as the method owner

   var DL_bIE = document.all ? true : false; // initialize var to identify IE
                                     
   var nLeftPos = eElement.offsetLeft;       // initialize var to store calculations 
   var eParElement = eElement.offsetParent;  // identify first offset parent element                            

   while (eParElement != null)                 
   {                                         // move up through element hierarchy
      if(DL_bIE)
      {
         if(eParElement.tagName == "TD")     // if parent a table cell, then...
         {
            nLeftPos += eParElement.clientLeft; // append cell border width to calcs
         }
      }

      nLeftPos += eParElement.offsetLeft;    // append left offset of parent
      eParElement = eParElement.offsetParent; // and move up the element hierarchy
   }                                         // until no more offset parents exist
   return nLeftPos;                          // return the number calculated
}
    
function DL_GetElementTop(eElement)
{
   if (!eElement && this)                    // if argument is invalid
   {                                         // (not specified, is null or is 0)
      eElement = this;                       // and function is a method
   }                                         // identify the element as the method owner

   var DL_bIE = document.all ? true : false; // initialize var to identify IE
                                     
   var nTopPos = eElement.offsetTop;       // initialize var to store calculations 
   var eParElement = eElement.offsetParent;  // identify first offset parent element                            

   while (eParElement != null)                 
   {                                         // move up through element hierarchy
      if(DL_bIE)
      {
         if(eParElement.tagName == "TD")     // if parent a table cell, then...
         {
            nTopPos += eParElement.clientTop; // append cell border width to calcs
         }
      }

      nTopPos += eParElement.offsetTop;    // append top offset of parent
      eParElement = eParElement.offsetParent; // and move up the element hierarchy
   }                                         // until no more offset parents exist
   return nTopPos;                          // return the number calculated
}


function getSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ];
}
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

var myImageTimer;
function etim() {
	window.clearTimeout(myImageTimer);
	var doc = $id('imgLyr');
	if(doc) {
		doc.style.display='none';
	}
}
function stim(str,e,id) {
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
	var x = DL_GetElementLeft(targ) + 400;
	var y = DL_GetElementTop(targ) + 25;
	var scrollPosY = getScrollXY()[1] + getSize()[1];
	var height = document.documentElement.scrollHeight;
	if((scrollPosY-225) < y || (height-250) < y) {
		y = y - 250;
	}
	myImageTimer = setTimeout('lim(\''+str+'\',\''+id+'\','+x+','+y+')', 250);
}
function lim(s,id,x,y) {
	var doc = $id('imgLyr');
	if(!doc) {
		doc = document.createElement('div');
		doc.id = 'imgLyr';
		$id('body').appendChild(doc);
		doc.style.zIndex=100;
		doc.style.position='absolute';
		doc.style.border='1px solid #000';
		doc.style.backgroundColor='#fff';
	}
	doc.style.left=x+'px';
	doc.style.top=y+'px';
	doc.innerHTML = '<img src="'+s+'" alt="" />';
	doc.style.display='block';
}

function addEvent2(obj, evType, fn, useCapture, params){
  if (obj.addEventListener){
    obj.addEventListener(evType, fn, useCapture);
  	obj.myparams = params;
    return true;
  } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    r.myparams = params;
    return r;
  } else {
    alert("Handler could not be attached");
  }
}

function addEvent(obj,type, fn, p ){
	obj["e"+type+fn] = fn;
	if (obj.addEventListener){
		eval( 'obj.addEventListener( type, function(event){	obj["e"+type+fn](event, ' + p + ')}, false );' 
		);
	} else if (obj.attachEvent){
		obj[type+fn] = function() { 
			eval ( 'obj["e"+type+fn](window.event, ' + p + ');' ); 
		}
		obj.attachEvent("on"+type, obj[type+fn]);
	}
}UIMessage = new Object();
/**
* private methods
**/
UIMessage._dn = function(uid, msg, cls, itemAdded) {
	addEvent(window, 'load', this._cn, "'"+uid+"', '"+msg+"', '"+cls+"',"+ itemAdded);
}
UIMessage._cn = function(obj, uid, msg, cls, itemAdded) {
	
	if(uid=='') {
		var doc = $id('messages');
		var newNode = document.createElement('DIV');
		newNode.className ='test1';
		
		var mess = msg;
		doc.style.visibility='visible';
		newNode.innerHTML = mess;
		newNode.style.width = 400+'px';
		newNode.style.textAlign ='center';
		doc.insertBefore(newNode,doc.firstChild);
		return;
	}
	
	if(itemAdded) {
		var doc = $id("messages");
		var tr = doc.parentNode;
		
		if(msg!='') {
			var x = DL_GetElementLeft(doc);
			var y = DL_GetElementTop(doc);
			
			var e = document.createElement('DIV');
			e.className ='test1';
			e.style.width = 400+'px';
			e.style.textAlign ='center';
			e.innerHTML=msg;
					
			e.style.left = (x)+'px';
			e.style.top = (y)+'px';
			
			$id('body').insertBefore(e,$id('body').firstChild);
			y = DL_GetElementTop(e);
			window.scrollTo(0, y-100);
		}
		return;
	}
	
	var r = $id(uid);
	if(r) {
		r = r.parentNode;
		
		var n = document.createElement('DIV');
		n.className='red';
		n.innerHTML=' (!)';
		r.appendChild(n);
		
		if(msg!='') {
		
			var x = DL_GetElementLeft(n);
			var y = DL_GetElementTop(n);
			
			var e = document.createElement('DIV');
			e.className ='test1';
			
			e.innerHTML=msg;
					
			e.style.left = x+'px';
			e.style.top = y+'px';
			
			$id('body').insertBefore(e,$id('body').firstChild);
			window.scrollTo(0, (y+-20));
		}
		
	}
	
}
//display node
UIMessage.dn = UIMessage._dn;function openGroup(e, id) {
	setFooter();
	
	var docs = document.getElementsByClassName("op");
	for(var i = 0; i < docs.length; i++) {
		var closeId = docs[i].id;
		$id("optext"+closeId).style.display='block';
		$id("opprice"+closeId).style.display='none';
	}
	if(id) {
		$id("optext"+id).style.display='none';
		$id("opprice"+id).style.display='block';
	}
}

function setFooter() {
	return;
	
	//var bName = navigator.appName;
	
	//var foot = document.getElementById("footer");
	//var canvas = document.getElementById("canvas");
	//alert(bName);
	//if(foot && bName.indexOf("Microsoft")!=-1) {
		//foot.style.position='relative';
		//foot.style.position='absolute';
		//var body = document.getElementsByTagName('body')[0];
//		alert(body.offsetHeight);
//		foot.style.bottom = '1px'; 
		//foot.style.top = body.offsetHeight-60;
	//}
	//if(canvas && bName.indexOf("Microsoft")!=-1) {
//		foot.style.position='relative';
		//var body = document.getElementsByTagName('body')[0];
		//alert(body.offsetHeight);
		//canvas.style.height = body.offsetHeight; 
	//}
}

function resize_iframe()
{

	var height=window.innerWidth;//Firefox
	if (document.body.clientHeight)
	{
		height=document.body.clientHeight;//IE
	}
	//resize the iframe according to the size of the
	//window (all these should be on the same line)
	document.getElementById("ifr").style.height=parseInt(height-
	document.getElementById("ifr").offsetTop-8)+"px";
}

window.onload=setFooter;


