/*
//browser detection
var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
            && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));

//tooltip Position
var offsetX = 0;
var offsetY = 5;
var opacity = 100;
var toolTipSTYLE;

function initToolTips(){
  if(document.getElementById){
          toolTipSTYLE = document.getElementById("toolTipLayer").style;
  }
  if(is_ie || is_nav6up)
  {
    toolTipSTYLE.visibility = "visible";
    toolTipSTYLE.display = "none";
    document.onmousemove = moveToMousePos;
  }
}
function moveToMousePos(e)
{
  if(!is_ie){
    x = e.pageX;
    y = e.pageY;
  }else{
    x = event.x + document.body.scrollLeft;
    y = event.y + document.body.scrollTop;
  }

  toolTipSTYLE.left = x + offsetX+'px';
  toolTipSTYLE.top = y + offsetY+'px';
  return true;
}


function toolTip(msg, fg, bg)
{
  if(toolTip.arguments.length < 1) // if no arguments are passed then hide the tootip
  {
    if(is_nav4)
        toolTipSTYLE.visibility = "hidden";
    else
        toolTipSTYLE.display = "none";
  }
  else // show
  {
      
  var content=msg;
   if(is_nav4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }

    else if(is_ie || is_nav6up)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
  }
}

function preview_image(url){
    var msg="<img src='"+url+"' />";
    
    toolTip(msg);
}
*/

function ajax_update(element_id, url, parameter)
{

	var x = new Ajax.Updater(element_id,url, {parameters: parameter});

}


function ajax_update_complete(element_id, url, parameter, complete_function)
{
	var x = new Ajax.Updater(element_id,url, {parameters: parameter , evalScripts: true, onComplete:complete_function});
}

function update_cart_qty(artwork_id, price)
{
	var qty_id = 'qty-' + artwork_id;
	var subtotal_id = 'subtotal-' + artwork_id;
	var qty = document.getElementById(qty_id);
	alert(price);

	ajax_update(subtotal_id, 'update_cart.php', {item_id: artwork_id, qty:qty.value, price:price});
}

function ajax_update2(element_id, url)
{

	var x = new Ajax.Updater('test','aircraft_list.php');

}

function jump_to_page(page, start)
{
	document.jump_to_page.page.value = page;
	document.jump_to_page.start.value = start;
	document.jump_to_page.submit();
}

function Minimize() 
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;

}

function Maximize() 
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}

function Maximize_image(width, height)
{
	
	
}

function redirect_login()
{
	window.location = "/member.php";
}

activateMenu = function(nav) {

/* currentStyle restricts the Javascript to IE only */
	if (document.all &&
 document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */

        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {   
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}

function clear_text(element, default_text)
{
    if (element.value == default_text)
    {
        element.value = "";    
    }
    
}

