// JQuery Scripts
$(document).ready(function(){
	
	$("ul.sf-menu").supersubs({ 
		minWidth:    11,   // minimum width of sub-menus in em units 
		maxWidth:    15,   // 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({		
		animation:   { height: 'show' }  // fade-in and slide-down animation
	});  // call supersubs first, then superfish, so that subs are 
			 // not display:none when measuring. Call before initialising 
			 // containing tabs for same reason. 

    $('ul.sf-menu li li.last').after('<div class="menu-left-corner"></div><div class="menu-right-corner"></div>');
    $('ul.sf-menu li ul li ul .menu-left-corner').remove();
	$('ul.sf-menu li ul li ul .menu-right-corner').remove();


/**
 * Image Rollover Functionality
 */
	$(".rollover").mouseover(function(){
		imgsrc = $(this).attr("src");
		matches = imgsrc.match(/-ro/);
		// don't do the rollover if state is already ON
		if (!matches) {
			
			if(imgsrc.indexOf('.gif') > -1) {
				imgsrcON = imgsrc.replace(/.gif$/ig,"-ro.gif"); // strip off extension - Gif
			} else if(imgsrc.indexOf('.jpg') > -1) {
				imgsrcON = imgsrc.replace(/.jpg$/ig,"-ro.jpg"); // strip off extension - Jpg		
			} else if(imgsrc.indexOf('.png') > -1) {
				imgsrcON = imgsrc.replace(/.png$/ig,"-ro.png"); // strip off extension - Jpg		
			}

			$(this).attr("src", imgsrcON);
		}
	});
	
	$(".rollover").mouseout(function() {
		$(this).attr("src", imgsrc);
	});

});


function addBookmark(title,url) { 
 if (window.sidebar) { 
 	window.sidebar.addPanel(title, url,""); 
 } else if( document.all ) { 
 	window.external.AddFavorite(url, title); 
 } else if( window.opera && window.print ) { 
 	return true; 
	}
}

function ValidateForm(theForm) {
if(theForm.clientcode.value == '') {
	alert('Please fill in the "Proposal Code" field.');
	theForm.clientcode.focus();
	return false;
	}
return true;
}




