function WindowPopup (url,width,height,addparam) {
	w = (width=="")?800:width;
	h = (height=="")?600:height;
	param = (addparam=="")?"scrollbars=auto,resizable=yes":addparam;
	window.open(url, "PopUp", "width="+w+",height="+h+","+param);
}

/*
 * Clear Default Text: functions for clearing and replacing default text in
 * <input> elements.
 */
//addEvent(window, 'load', init, false);

function init() {
	var formInputs = document.getElementsByTagName('input');
    for (var i = 0; i < formInputs.length; i++) {
        var theInput = formInputs[i];
        
        if (theInput.type == 'text' && theInput.className.match(/\bcleardefault\b/)) {  
            /* Add event handlers */          
			
            $('#q').focus(clearDefaultText); //converted to jQuery
			$('#q').blur(replaceDefaultText); //converted to jQuery
			//addEvent(theInput, 'focus', clearDefaultText, false);
            //addEvent(theInput, 'blur', replaceDefaultText, false);
            
            /* Save the current value */
            if (theInput.value != '') {
                theInput.defaultText = theInput.value;
            }
        }
    }
}

function clearDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == target.defaultText) {
        target.value = '';
    }
}

function replaceDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == '' && target.defaultText) {
        target.value = target.defaultText;
    }
}

$(document).ready(function() {
	init();
	$('.scImage').wrap("<div class='productimage'></div>");
	$('.scImage').parent().parent().parent().parent().addClass("productCell");
	if ($('.productCell').height() < 230) {
		$('.productCell').height("230px;");
	}
	if ($('.blueBody').height() > $('.rightDiv').height()) {
		$('.rightDiv').height($('.blueBody').height());
	} else {
		$('.blueBody').height($('.rightDiv').height());
	}
	//$('.productimage').corner("4px");
	$('div.whitebox').corner("5px");
	$('.lightbluebox').corner("5px");
	$('.sclightbluebox').corner("5px");
	$('.blueBody').corner("7px");
	$('.rightDiv').corner("7px");
	
 });
