var quosaTimer;
var quosaEl;

function getArgs() {
    var args = new Object(  );
    var query = location.search.substring(1);     
      // Get query string
    var pairs = query.split(",");
     // Break at comma
    for(var i = 0; i < pairs.length; i++) {
        var pos = pairs[i].indexOf('=');
          // Look for "name=value"
        if (pos == -1) continue;
          // If not found, skip
        var argname = pairs[i].substring(0,pos);
          // Extract the name
        var value = pairs[i].substring(pos+1);
          // Extract the value
        args[argname] = unescape(value);
         // Store as a property
       // In JavaScript 1.5, use decodeURIComponent(  ) 
       // instead of escape(  )
    }
    return args;     // Return the object
}

function openWithSelfMain(url,name,width,height,returnwindow) {
	var options = "width=" + width + ",height=" + height + ",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no";

	var new_window = window.open(url, name, options);
	window.self.name = "main";
	new_window.focus();
	if (returnwindow != null) {
	   return new_window;
	}
}

function openWin(url, w, h) {
	//Workaround stupid IE bug.
	try
	{
		window.w2.window.document.location=url;
	}
	catch (bug)
	{
		window.w2 = window.open(url, 'quosaPopup', 'scrollbars=yes, menubar=yes, location=yes, toolbar=yes, status=yes, resizable=yes, left=0,top=0, width=' + w + ', height=' + h);	
	}
	window.w2.window.focus();
	return w;
}
function openLink(url) {
	if (opener && opener.closed == false) {
		opener.location.href = url;
		opener.focus();
		window.close();
	} else {
		w = window.open(url, 'quosaMain', '');
		w.focus();
		window.close();
	}
}
function fullScreen(url) {
	w = window.open(url, 'quosaSwf', 'fullscreen=yes, scrollbars=auto');
	w.focus();
	return w;
}

function processList(id) {
	if (document.all&&document.getElementById) {
            navRoot = document.getElementById(id);
            for (i=0; i < navRoot.childNodes.length; i++) {
                  node = navRoot.childNodes[i];
                  if (node.nodeName == "LI") {
				  	
                        node.onmouseover = function() {
							this.className+=" over";
							//alert(this.className);
                        }
                        node.onmouseout = function() {
                              this.className = this.className.replace(" over", "");
							//alert('mouseOut: ' + this.className);
							//window.status = this.className;
					
                        }
						nodes = node.getElementsByTagName("ul");
						
/*						alert(nodes.length);*/
						if (nodes.length > 0) {
							ul = nodes[0];
				            for (j=0; j < ul.childNodes.length; j++) {
				                  subnode = ul.childNodes[j];
				                  if (subnode.nodeName == "LI") {
								  	
				                        subnode.onmouseover = function() {
											this.className=this.className+" over";
											//alert("over:"+this.className+"|"+this.id);
				                        }
				                        subnode.onmouseout = function() {
											//alert("1:"+this.className);
  				                              this.className = this.className.replace(" over", "");
											 //alert("out:"+this.className+"|"+this.id);
				                        }
				                  }
				            }
						}
			
                  }
            }
      }
}

function clearForm (f) {
	alert();
	for (var i = 0; i < f.length; i++) {
		var e = f.elements[i];
		e.value = '';
	}
}
