var agent = navigator.userAgent;
//alert(agent);
// special styles for FF <2 on mac =====================================
if ((agent.indexOf("Firefox/1.")>-1)&&(agent.indexOf("Macintosh")>-1)||(agent.indexOf("Firefox/1.0")>-1)&&(agent.indexOf("Windows")>-1)) {
	document.write('<style type="text/css">');
		document.write('.clear{height: 1px;}');
	document.write('</style>');
}
// ======================================================================

// special styles for Safari on mac =====================================
if ((agent.indexOf("Safari")>-1)&&(agent.indexOf("Macintosh")>-1)) {
	document.write('<style type="text/css">');
		document.write('#search_site .textfield{width: 107px;}');
		document.write('#search_site .custom_btn input{padding: 1px 0;}');
		document.write('#newsletter .mask{height: 14px; overflow: hidden;}');
		document.write('#products_table .price_quantity_row .qty input{width: 15px;}');
		document.write('#products_table .price_quantity_row .shades img{margin-top: 1px;}');
	document.write('</style>');
}
// ======================================================================

// special styles for AOL on mac =====================================
if ((agent.indexOf("AOL")>-1)&&(agent.indexOf("Macintosh")>-1)) {
	document.write('<style type="text/css">');
		document.write('.floating_container{position: static;}');
		document.write('.relative_content{position: static;}');
		document.write('.inline{overflow: visible;}');
		document.write('#background{z-index: 1; height: auto;}');
		document.write('#background .relative_content{top: 0px; width: 752px; background: #FFFFFF; height: 100%;}');
		document.write('#header .relative_content{background: #FFFFFF; width: 712px; padding: 0 20px 10px 20px}');
		document.write('#nav .relative_content{padding: 0 1px; background: #FFFFFF;}');
		document.write('#main_content{top: -79px; position: relative;}');
	document.write('</style>');
}
// ======================================================================

// special styles for Netscape ==========================================
if (agent.indexOf("Netscape")>-1) {
	document.write('<style type="text/css">');
		document.write('.clear{height: 1px;}');
	document.write('</style>');
}
// ======================================================================

// roll_subnav===========================================================
var now_roll_sub = "", now_roll_sub_img_elem = "", now_roll_sub_img = "";
var subnav_timeout = 300;
var verify_rollout = false;

function rollon_subnav(element_id, img_id, img){
	hide_roll_subnav(true);
	verify_rollout = false;
	now_roll_sub_img = img;
	now_roll_sub_img_elem = img_id;
	now_roll_sub_img_elem.src='images/'+img+'_on.gif';
	now_roll_sub=element_id;
	if (element_id!='') document.getElementById(element_id).style.display='block';
}

function rollout_subnav(){
	verify_rollout = true;
	setTimeout("hide_roll_subnav(false)", subnav_timeout);
}

function hide_roll_subnav(forceIt){
	if ((verify_rollout)||(forceIt)) {
		if (now_roll_sub!='') {
			document.getElementById(now_roll_sub).style.display='none';
			now_roll_sub = '';
		}
		if (now_roll_sub_img_elem!='') {
			now_roll_sub_img_elem.src='images/'+now_roll_sub_img+'.gif';
			now_roll_sub_img_elem='';
		}
	}
}

function mouse_active(){
	verify_rollout = false;
}
// =================================================================

function changeToNumeric(nowField){
	tmpValue = nowField;
	tmpValue = tmpValue.replace(/[^0-9]/ig,"");
	return tmpValue;
}
