function v_search_text_change(){
var searchValue = 'What are you looking for today?';
var mailValue = 'email address...';

	check_searchbox_focus = function(box) {			
		if (box.value == searchValue){
			box.value = '';
		}
	};
	
	check_searchbox_blur = function(box) {	
		if (box.value == '') {
			box.value = searchValue;
		}    
	};
		
	check_mailbox_focus = function(box) {			
		if (box.value == mailValue){
			box.value = '';
		}
	};
	
	check_mailbox_blur = function(box) {	
		if (box.value == '') {
			box.value = mailValue;
		}    
	};
}		

function v_removeSinglePagination(){
	var txt = document.getElementById("content_area").getElementsByTagName("div");
        for (var i = 0; i < txt.length; i++){
            if ( txt[i].className=="pages_available_text" && txt[i].innerHTML.replace(/^\s+|\s+$/g,'')=='1' )
		txt[i].style.display="none";
        }
}

function v_customMultiChildAddToCart(){
if (PageName() == "productdetails.asp") {

var source;
var destination;

//remove item#
source = jQuery("#content_area tr.Multi-Child_Background td, #content_area tr.colors_backgroundlight td").each(function(index){
    var i = jQuery(this).html(); 
    if( ((i.search(global_Current_ProductCode.replace('-fslash-','/')) >= 0) && (jQuery("input", this).size() <= 0)) || (i.search('Item#') >= 0) )
        jQuery(this).html("");
});

//move table
source = jQuery("#content_area tr.Multi-Child_Background").closest('table');
destination = (jQuery("#content_area a#product_photo_zoom_url").size() > 0) ? jQuery("#content_area a#product_photo_zoom_url").closest("td") : jQuery("#product_photo").closest("td");
source.insertAfter(destination);

//add classes for styling
source.addClass("v_customMultiChildAddToCart_right_inner");
destination.addClass("v_customMultiChildAddToCart_left");

//handle product description above pricing
destination = jQuery('.v_customMultiChildAddToCart_right_inner').wrap('<td class="v_customMultiChildAddToCart_right" align="right" valign="top" />');
if( jQuery("#content_area table.colors_pricebox").size() > 0 ){
    var errors = jQuery("#listOfErrorsSpan");
    var proddescabovepricing = jQuery("#content_area table.colors_pricebox");
    proddescabovepricing.parent().remove();
    proddescabovepricing.addClass("v_customMultiChildAddToCart_proddescabovepricing");
    errors.insertBefore(destination);
    proddescabovepricing.insertBefore(destination);
}

//create tabs for product description, features, technical specs
source = jQuery("#content_area > form > table:eq(1)"); 
var desc = jQuery("table:eq(0)",source);
var info = jQuery("table:eq(1)",source);

//create tab titles
var str = '<ul id="v_custom_multichildaddtocart_infotabs"><li><a href="#tab0"><span class="vcustom">Description:</span></a></li>';
var infoTabs;
infoTabs = jQuery("b",info).each(function(index){
        if(jQuery(this).html().search('Extended Information') < 0)
            str = str + '<li><a href="#tab' + (index+1) + '"><span class="vcustom">' + jQuery(this).html() + '</span></a></li>';
});
str = str + '</ul>';
infoTabs = str;

//create tab divs
str = '<div id="tab0">'+ desc.html() +'</div>';
var infoDivs ;
infoDivs = jQuery("ul",info).each(function(index){
  str = str + '<div id="tab' + (index+1) + '"><ul>' + jQuery(this).html() + '</ul></div>'; 
});
infoDivs = '<div id="v_custom_multichildaddtocart_infodivs">' + str + '</div>';

source.before(infoTabs);
source.before(infoDivs);
source.remove();

//bind click to activate
jQuery("#v_custom_multichildaddtocart_infodivs > div").addClass("unselected");
jQuery("#v_custom_multichildaddtocart_infodivs > div:first").removeClass("unselected");

jQuery("#v_custom_multichildaddtocart_infotabs a").click(function(){
    jQuery("#v_custom_multichildaddtocart_infodivs > div").addClass("unselected");
    var selectedTab = jQuery(this).attr("href");
    jQuery(selectedTab).removeClass("unselected");
    return false;
});


}
}

function v_appendToFunction(js, func) {
    var text = func.toString();

    var startAt = text.indexOf("function") + 9;
    var endAt = text.indexOf("(");
    var funcName = text.substr(startAt, endAt - startAt).replace("\\s", "");

    var startAt = text.indexOf("(") + 1;
    var endAt = text.indexOf(")");
    var params = text.substr(startAt, endAt - startAt);
    params = params.replace(/\s/g, "");
    params = "\"" + params.replace(/\,/g, "\",\"") + "\"";

    var startAt = text.indexOf("{") + 1;
    text = text.substr(startAt, text.length - startAt - 1);
    text = text + "\r\n" + js;

    text = text.replace(/"/g, "\\\"");
    text = text.replace(/[\r\n]+/g, "\\r\\n\" + \r\n\"");
    evalCode = funcName + " = new Function(" + params + ",\"" + text + "\")";

eval(evalCode);
}

function v_fixSoftAddProductNames() {
    var txt = jQuery(".soft_add_content_area .product_name").each(function(index){
        var t = jQuery(this).html();
        t = t.substr(t.indexOf('&gt;') + 4);
        jQuery(this).html(t);

    });
}

