/*  SEARCH BOX CLEAR Copyright (c) 2008 Brandon Aaron (http://brandonaaron.net)
  * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
  * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
  *
  * $LastChangedDate$
  * $Rev$
  *
  * Version 0.2
  *
  * Usage:
  *   $("input[name=q]")
  *      .val("Search")    // set an initial value if it doesn't already exist
  *      .clearonfocus();  // prepare the element for clearing on focus
  */
 jQuery.fn.clearonfocus = function() {
     return this
         .bind('focus', function() {
             // Set the default value if it isn't set
             if ( !this.defaultValue ) this.defaultValue = this.value;
             // Check to see if the value is different
             if ( this.defaultValue && this.defaultValue != this.value ) return;
             // It isn't, so remove the text from the input
             this.value = '';
         })
         .bind('blur', function() {
             // If the value is blank, return it to the defaultValue
             if ( this.value.match(/^\s*$/) )
                 this.value = this.defaultValue;
         });
 };

/*$(document).ready(function(){
$('#s').val("Search Site").clearonfocus();
});*/


/* DROP DOWN MENU - The following 2 items call the dropdown menu behaviors. First up is a function that expands the dropdown to the largest sub item. Must come first. After that is the SuperFish menu call itself. */
$(document).ready(function(){ 
        $("ul.sf-menu").supersubs({ 
            minWidth:    9,   // minimum width of sub-menus in em units 
            maxWidth:    27,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 
    }); 

jQuery(function(){
	jQuery('ul.sf-menu').superfish();
});

function openWin(URL,w,h) {
	eval("page" + " = window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0, width=' + w + ',height=' + h);");
}

function changeMenu(i,x) {
	if(i.indexOf("Over")!=-1) {
	document.getElementById(x).src="//dev.vwire.com/img/"+i+".gif";
	} else {
	document.getElementById(x).src="//dev.vwire.com/img/"+i+".gif";
	}
}
