<!-- hide script from old browsers

/*
$(function() {  
 // OPACITY OF BUTTON SET TO 50%  
$("#cart_cont").css("opacity","0");      
$("#cart_cont").css("visibility","hidden");   

// ON MOUSE OVER  
$("#span_cart").hover(function () {  
// SET OPACITY TO 100%  

load_cart();
$("#cart_cont").css("visibility","visible");
 
$("#cart_cont").stop().fadeTo(300, 1);  
 },     
// ON MOUSE OUT 
function () {  
// SET OPACITY BACK TO 0%  
$("#cart_cont").stop().fadeTo(100, 0,function(){$("#cart_cont").css("visibility","hidden");}); 
 
});  


}); 
*/

$(function() {  
 // OPACITY OF BUTTON SET TO 50%  
$("#cart_cont").css("opacity","0");      
$("#cart_cont").css("visibility","hidden");   

// ON MOUSE OVER  
$("#span_cart").hover(function () {  
// SET OPACITY TO 100%  

load_cart();
$("#cart_cont").css("visibility","visible");
 
$("#cart_cont").stop().fadeTo(300, 1);  
 },     
// ON MOUSE OUT 
function () {  
// SET OPACITY BACK TO 0%  
$("#cart_cont").css("visibility","hidden");  
 
});  


}); 


$(function() {  
 // OPACITY OF BUTTON SET TO 50%  
$("#question_links").css("opacity","0");      
$("#question_links").css("visibility","hidden");   

// ON MOUSE OVER  
$("#span_questions").hover(function () {  
// SET OPACITY TO 100%  


$("#question_links").css("visibility","visible");
 
$("#question_links").stop().fadeTo(300, 1);  
 },     
// ON MOUSE OUT 
function () {  
// SET OPACITY BACK TO 0%  
$("#question_links").stop().fadeTo(300, 0,function(){$("#question_links").css("visibility","hidden");}); 
 
});  


}); 


$(function() {  
 // OPACITY OF BUTTON SET TO 50%  
$("#account_links").css("opacity","0");      
$("#account_links").css("visibility","hidden");   

// ON MOUSE OVER  
$("#span_account").hover(function () {  
// SET OPACITY TO 100%  


$("#account_links").css("visibility","visible");
 
$("#account_links").stop().fadeTo(300, 1);  
 },     
// ON MOUSE OUT 
function () {  
// SET OPACITY BACK TO 0%  
$("#account_links").stop().fadeTo(300, 0,function(){$("#account_links").css("visibility","hidden");}); 
 
});  

}); 

var server_name = "www.myhobbybox.com";


	function chgcolorbg(objname)
	{
		var box;
	
		box = document.getElementById(objname);
		box.style.background = '#feffd2';
	}

	function setbgcolor(objname,color)
	{
		var box;

		box = document.getElementById(objname);
		box.style.background = color;
	}

	function ref_img_change(obj,orginal)
	{
		var ob;

		ob = document.getElementById(obj);
		if(orginal)
		{
			ob.src = "images/" + obj + ".png";
		}
		else
		{
			ob.src = "images/" + obj + "_under.png";
		}

	}

	function ItemPreview(ItemID)
	{
		if(document.getElementById('quick').style.visibility == "visible") return;

		LoadPreview(ItemID);
		document.getElementById('preview').style.visibility='visible';

		//document.getElementById('preview').style.top = event.y - 25;
		//document.getElementById('preview').style.left = event.x + 155;
	}

	function LoadPreview(ItemID)
	{ 
		var req = null; 
		var itemname = "";
		var desc = "";
		var psrc = "";

		if(window.XMLHttpRequest)
			req = new XMLHttpRequest(); 
		else if (window.ActiveXObject)
			req  = new ActiveXObject(Microsoft.XMLHTTP); 


		try{
			req.onreadystatechange = function()
			{ 
				if(req.readyState == 4)
				{
					if(req.status == 200)
					{
						data = req.responseText;
						itemname = data.split("#")[1];
						itemname = itemname.substr(itemname.indexOf("=") + 1);
						document.getElementById('iname').value = itemname;
						//document.getElementById('iname').size = itemname.length;
					
						desc = data.split("#")[3];
						desc = desc.substr(desc.indexOf("=") + 1);
						document.getElementById('itemdesc').value = desc;
					
						psrc = data.split("#")[4];
						psrc = psrc.substr(psrc.indexOf("=") + 1);
						document.getElementById('pic').src = psrc;
					
	
					}	
					
				} 
			};
 
			req.open("GET", "preview_item.php?itemid=" + ItemID, true); 
			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
			req.send(null); 
		
		}
		catch (e)
		{
			window.alert(e.message);
		}
	}

	function LoadQuickView(ItemID)
	{ 
		var req = null; 
		var itemname = "";
		var desc = "";
		var psrc = "";
		var price = "";
		var img1 = null;
		var subinfo = "";
		var scale = "";
		var cat;

		if(window.XMLHttpRequest)
			req = new XMLHttpRequest(); 
		else if (window.ActiveXObject)
			req  = new ActiveXObject(Microsoft.XMLHTTP); 

		//window.alert(ItemID);

		try{
			
			req.open("GET", "preview_item2.php?itemid=" + ItemID, false); 
			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
			req.send(null); 
			 
				if(req.readyState == 4)
				{
					if(req.status == 200)
					{
						data = req.responseText;
							
						itemname = data.split("#")[2];
						itemname = itemname.substr(itemname.indexOf("=") + 1);

						desc = data.split("#")[3];
						desc = desc.substr(desc.indexOf("=") + 1);
						document.getElementById('quickdesc').value = desc;
						
						scale = data.split("#")[4];
						scale = scale.substr(scale.indexOf("=") + 1);
						
						if(scale != null) subinfo = scale + " ";

						cat = data.split("#")[10];
						cat = cat.substr(cat.indexOf("=") + 1);
						
						if(cat != null) subinfo = subinfo + cat;


						if(subinfo != null) document.getElementById('subinfo').value = subinfo;

						itemid = data.split("#")[1];
                                                itemid = itemid.substr(itemid.indexOf("=") + 1);
                                                document.getElementById('quickitemid').value = itemid;
	
						psrc = data.split("#")[7];
						psrc = psrc.substr(psrc.indexOf("=") + 1);
						
						img1 = new Image();
						img1.src = psrc;
						
						document.getElementById('quickpic').src = psrc;
						//document.getElementById('quickpic').height = img1.height;
						//document.getElementById('quickpic').width = img1.width;
						
										 
						 price = data.split("#")[6];
                                                price = price.substr(price.indexOf("=") + 1);
                                                document.getElementById('quickprice').value = price;

						status = data.split("#")[8];
                                                status = status.substr(status.indexOf("=") + 1);
                                                document.getElementById('quickstatus').value = status;
						
						document.getElementById('quickname').value = itemname;
						
						stock = data.split("#")[9];
                                                stock = stock.substr(stock.indexOf("=") + 1);

						var selectqty = document.getElementById("qty");

						for(var i =0; i <= selectqty.length; i++)
						{
						  selectqty.remove(i);
						}
						
						if(stock > 9) stock = 9;

						for(var i=1; i <= stock; i++)
						{
							selectqty.options[i-1]=new Option(i,i);
						}	
	
	
					}	
					
				} 
		
 
			
		
		}
		catch (e)
		{
			window.alert(e.message);
		}
}

function toogleQuickView(itemid)
{
	if(document.getElementById('quick').style.visibility== "visible" && itemid == document.getElementById('quickitemid').value)
	{
		document.getElementById('quick').style.visibility="hidden";
	}
	else
	{
		var selectqty = document.getElementById("qty");

		selectqty.length=0;
		
		LoadQuickView(itemid);
		document.getElementById('quick').style.visibility = "visible";
		resize('quickpic',200);

		document.getElementById('preview').style.visibility = "hidden";

	}

}

function clear_box(obj,defa)
{
	var my_obj = document.getElementById(obj);

	if(my_obj.value = defa)
	{
		my_obj.value = "";
	}
}

/*
function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }
*/

function resize(which, max) {
  var elem = document.getElementById(which);
  if (elem == undefined || elem == null) return false;
  if (max == undefined) max = 100;
  if (elem.width > elem.height) 
   {
    if (elem.width > max) elem.width = max;
  } else {
    if (elem.height > max) elem.height = max;
  }
}

function toogle_watch_item(show)
{
  if(document.getElementById('divwatch').style.visibility=='visible') show=false;
  
  if(show == true)
  {
      document.getElementById('divwatch').style.visibility='visible';
      opacity('divwatch',0,100,400);
  }
  else
  {
     opacity('divwatch',100,0,600);
     document.getElementById('divwatch').style.visibility='hidden';
     
  }

}


function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 85); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    /*if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else*/ if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            {
			
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++;
			
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")";
		
}


var spot1,spot2,spot3,spot4,spot5;
var top_spot1="20px";
var top_spot2="85px",top_spot3="155px",top_spot4="225px",top_spot5="315px";

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function ReadCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject


function move(objname){


	obj = getStyleObject(objname);

	if(spot1 == null || spot1 == spot2)
	{
		obj.visibility="visible";
		obj.top = top_spot1;
		obj.bottom = null;
		opacity(objname,0,100,700);
		spot1=objname;
	}
	else if(spot2 == null)
	{
		obj.visibility="visible";
		opacity(objname,0,100,700);
		obj.top = top_spot2;
		obj.bottom = null;
		spot2=objname;
	}
	else if(spot3 == null)
	{
		obj.visibility="visible";
		opacity(objname,0,100,700);
		obj.top = top_spot3;
		obj.bottom = null;
		spot3=objname;
	}
	else if(spot4 == null)
	{
		obj.visibility="visible";
		opacity(objname,0,100,700);
		obj.top = top_spot4;
		obj.bottom = null;
		spot4=objname;
	}
	else if(spot5 == null)
	{
		obj.visibility="visible";
		opacity(objname,0,100,700);
		obj.top = top_spot5;
		obj.bottom = null;
		spot5=objname;
	}
	else
	{
		window.alert("Out of Empty Spots");
	}
	//per_div = getStyleObject("perm");

	//obj = getStyleObject("div2");
	//obj.top = per_div.bottom + "1px"

}


function remove(objname)
{
	obj = getStyleObject(objname);

	if(spot1 == objname)
	{
		obj.bottom = "0px";
		//opacity(objname,100,0,500);
		changeOpac(0,objname);
		obj.visibility="hidden";
		spot1=null;
	}
	else if(spot2 == objname)
	{
		obj.bottom = "0px";
		//opacity(objname,100,0,500);
		obj.visibility="hidden";
		changeOpac(0,objname);
		spot2=null;
	}
	else if(spot3 == objname)
	{
		obj.bottom = "0px";
		//opacity(objname,100,0,500);
		obj.visibility="hidden";
		changeOpac(0,objname);
		spot3=null;
	}
	else if(spot4 == objname)
	{
		obj.bottom = "0px";
		//opacity(objname,100,0,500);
		obj.visibility="hidden";
		changeOpac(0,objname);
		spot4=null;
	}
	else if(spot5 == objname)
	{
		obj.bottom = "0px";
		//opacity(objname,100,0,500);
		obj.visibility="hidden";
		changeOpac(0,objname);
		spot5=null;
	}
	else
	{
		window.alert("Not Found");
	}

	shiftobjects();
}

function shiftobjects()
{
	var j=0;

	for(j=0;j<=4;j++)
	{
		if(spot1 == null && spot2 != null)
		{
			move(spot2);
			spot2 = null;

			
		}
		else if(spot2 == null & spot3 != null)
		{
			move(spot3);
			spot3 = null;

			
		}
		else if(spot3 == null & spot4 != null)
		{
			move(spot4);
			spot4 = null;

			
		}
		else if(spot4 == null & spot5 != null)
		{
			move(spot5);
			spot5 = null;			
		}

	}


}

function toogle_box_div(obj,status)
{

	if(status == true)
	{
		move(obj);
	}
	else
	{	
		remove(obj);
	}

}


function addElement(content)
{
  // create a new div element
  // and give it some content
  newDiv = document.createElement("div");
  newDiv.setAttribute('class', 'minicart'); 
  newDiv.innerHTML = content;

  // add the newly created element and it's content into the DOM
  my_div = document.getElementById("cart_cont");
  my_div.appendChild(newDiv);
}

function load_cart()
{


if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  	//xhttp=new ActiveXObject("Microsoft.XMLHTTP")	
	// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP.6.0");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	
  }
 


xhttp.open("GET","preview_cart.php",false);

xhttp.send("");

xmlDoc=xhttp.responseXML;

var item_name,qty,price,itemid,link;
var x=xmlDoc.getElementsByTagName("item");
var context,link;
var total_items, subtotal;

total_items = 0;
subtotal = 0;

deleteNode('cart_cont');

content = "<div style='position: relative; float: left; width: 300px; padding-bottom: 5px;'>Item Name</div><span>Qty</span><span style='width:10%; float:right;'>Price</span>";
//addElement(content);


for (var i =0; i < x.length; ++i) {
	item_name = x[i].getElementsByTagName("item_name")[0].childNodes[0].nodeValue;
	qty = x[i].getElementsByTagName("qty")[0].childNodes[0].nodeValue;
	price = x[i].getElementsByTagName("price")[0].childNodes[0].nodeValue;
	itemid = x[i].getElementsByTagName("itemid")[0].childNodes[0].nodeValue;
	pic = x[i].getElementsByTagName("picture")[0].childNodes[0].nodeValue;
	
	link = "show_item.php?itemid=" + itemid;
	total_items += parseFloat(qty);
	subtotal += parseFloat(price);

	content = "<div class='preview_cart'><div style='display: inline; float: left; width: 90px;'><img src='" + pic + "' height=50 ALIGN=MIDDLE></div><div style='display: inline; float: left; width: 200px;''><a class='clearplainlink' href='" + link + "'>" + item_name + " <br> Quantity: " + qty + " Price: $" + price + "</a></div><div><a class='BoldUnderLine' href='javascript:(void(0));' onclick=\"modify_cart('" + itemid + "'," + (qty * -1) + ");load_cart();\">Remove</a></div></div>";

	
		addElement(content);
    }
    
	if(x.length == 0)
	{
  		addElement("<center><span style='font-family:  Corbel, Verdana, Arial, Helvetica, sans-serif; font-size: 18pt;'>Your Cart Is Empty</span></center>");
	}
	else
	{
		content = "<a class-'minilink' href='checkout.php'><div style='position: relative; float: left; width: 300px; overflow:hidden;padding-bottom: 15px; font-size: 9pt;'>Check Out</div><span></span><span style='width:10%; float:right;'></span></a>";
		content = "<a class-'minilink' href='show_cart.php'><div style='position: relative; float: left; width: 300px; overflow:hidden;padding-bottom: 15px; font-size: 9pt;'>Check Out</div><span>" + total_items + "</span><span style='width:10%; float:right;'>$" + subtotal + "</span></a>";
		content = "<div style='height: 30px'></div>";
		addElement(content);
	}
  
}



function switch_image(source, new_image, switch_bgcolor, ch_sp)
{

	var img, sp, dv;
	
	img = document.getElementById(source);
	
	img.src= new_image;

	sp = document.getElementById(ch_sp);
	
	if(switch_bgcolor == 0)
	{
		sp.style.backgroundColor = "#f7efdb";
	}
	else
	{
		sp.style.backgroundColor = "#2061a4";
	}
	
	

}


function deleteNode(deleteselect){
  var myselect=document.getElementById(deleteselect);	

	myselect.innerHTML = "";

}


// Fast javascript function to clear all the options in an HTML select element
// Provide the id of the select element
// References to the old <select> object will become invalidated!
// This function returns a reference to the new select object.
function ClearOptionsFast(id)
{
	var selectObj = document.getElementById(id);
	var selectParentNode = selectObj.parentNode;
	var newSelectObj = selectObj.cloneNode(false); // Make a shallow copy
	selectParentNode.replaceChild(newSelectObj, selectObj);
	return newSelectObj;
}

function gup(name)
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

function submit_search()
{
	var f = document.forms.search;
	document.cookie = 'newsearch=true; expires=Thu, 2 Aug 2101 20:47:11 UTC; path=/';
	f.submit();
}


function home_tab_change(active_tab_id)
{
  
  
  $("#tab_news").css("visibility","hidden");
  $("#tab_popular").css("visibility","hidden");
  $("#tab_feature").css("visibility","hidden");
  $("#tab_restocks").css("visibility","hidden");
  
  $("#tab_news").css("opacity","0"); 
  $("#tab_feature").css("opacity","0"); 
  $("#tab_popular").css("opacity","0"); 
  $("#tab_restocks").css("opacity","0");
 
  if(active_tab_id == "tab_news")
  {
    $("#tab_news").css("visibility","visible");
    $("#tab_news").stop().fadeTo(500, 1); 
  }
  else if(active_tab_id == "tab_popular")
  {
    $("#tab_popular").css("visibility","visible");
    $("#tab_popular").stop().fadeTo(500, 1);   
  }
  else if(active_tab_id == "tab_restocks")
  {
    $("#tab_restocks").css("visibility","visible");
    $("#tab_restocks").stop().fadeTo(500, 1);
  }
  else
  {
    $("#tab_feature").css("visibility","visible");
    $("#tab_feature").stop().fadeTo(500, 1); 
  }
  
}

function quick_search()
{
	//clear all search cookies
	Reset_Search();
	var search = document.getElementById('qsearch').value;
	
	
	createCookie('qsearch',search,1);
	createCookie('startp',1,1);
	
	//window.location('search_results.php');
	location.href="http://www.myhobbybox.com/search_results.php";

}

function full_search()
{
	//clear all search cookies
	Reset_Search();
	
	var search = document.getElementById('full_search').value;
	
	createCookie('qsearch',search,1);
	createCookie('startp',1,1);
	
	if(document.getElementById('src_mfg').checked)
	{
	  createCookie('mfgr', document.getElementById('src_mfgr').value,1);
	}
	
	
	if(document.getElementById('src_scale').checked)
	{
	  createCookie('scale', document.getElementById('src_sel_scale').value,1);
	}
	
	if(document.getElementById('src_new').checked)
	{
	  createCookie('release', document.getElementById('src_sel_new').value,1);
	}
	
	if(document.getElementById('src_cat').checked)
	{
	  createCookie('category', document.getElementById('src_sel_cat').value,1);
	}
	
	if(document.getElementById('src_stock').checked)
	{
	  createCookie('instock',1,1);
	}
	
	
	//window.location('search_results.php');
	location.href="search_results.php";

}

function new_release_search()
{
	//clear all search cookies
	Reset_Search();
	
	createCookie('startp',1,1);
	
	createCookie('release', document.getElementById('src_sel_new').value,1);
	
	if(document.getElementById('src_sel_category').value != "%")
	{
	    createCookie('category', document.getElementById('src_sel_category').value,1);
	}
	
	//window.location('search_results.php');
	location.href="search_results.php";

}

function crossref_search(cref, instock)
{
	Reset_Search();
	
	if(instock ==1) createCookie('instock',1,1);

	createCookie('cross_ref',cref,1);
	createCookie('startp',1,1);
	
	location.href="search_results.php";
}


function Reset_Search()
{

  eraseCookie('qsearch');
  eraseCookie('startp');
  eraseCookie('category');
  eraseCookie('mfgr');
  eraseCookie('scale');
  eraseCookie('release');
  eraseCookie('instock');
  eraseCookie('cross_ref');
  
}

function modify_cart(itemid,qty)
{
  var link,result;
  
  
  if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  	//xhttp=new ActiveXObject("Microsoft.XMLHTTP")	
	// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP.6.0");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	
  }
  
  
  link = "add_cart.php?redirect=no&itemid=" + itemid + "&qty=" + qty;


  xhttp.open("GET",link,false);

  xhttp.send("");


  xmlDoc=xhttp.responseXML;

  result =
  xmlDoc.getElementsByTagName("message")[0].childNodes[0].nodeValue;
  
  if(result != "1")
  {
	window.alert("Error In Removing Item From Cart");
  }
}


setUrlEncodedKey = function(key, value, query) {
   
    query = query || window.location.search;
    var q = query + "&";
    var re = new RegExp("[?|&]" + key + "=.*?&");
    if (!re.test(q))
        q += key + "=" + encodeURI(value);
    else
        q = q.replace(re, "&" + key + "=" + encodeURIComponent(value) + "&");
    q = q.trimStart("&").trimEnd("&");
    return q[0]=="?" ? q : q = "?" + q;
}

String.prototype.trimEnd = function(c) {
    if (c)        
        return this.replace(new RegExp(c.escapeRegExp() + "*$"), '');
    return this.replace(/\s+$/, '');
}
String.prototype.trimStart = function(c) {
    if (c)
        return this.replace(new RegExp("^" + c.escapeRegExp() + "*"), '');
    return this.replace(/^\s+/, '');
}

String.prototype.escapeRegExp = function() {
    return this.replace(/[.*+?^${}()|[\]\/\\]/g, "\\$0");
};

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
};
	
// end hiding script from old browsers -->

