var css_on = "#ffcc00";
var css_off = "#8073a8";

function flash(version, filename, name, width, height, wmode, bgcolor, menu, flashvars, salign) {
	salign==false ? salign="lt":"";
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+width+'" height="'+height+'" id="'+name+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain"/>');
	document.write('<param name="allowFullScreen" value="true"/>');
	document.write('<param name="wmode" value="'+wmode+'"/>');
	document.write('<!-- Flash FIX v0.3 | www.mega.by -->');
	document.write('<param name="bgcolor" value="'+bgcolor+'"/>');
	document.write('<param name="salign" value="'+salign+'"/>');
	document.write('<param name="movie" value="'+filename+'"/>');
	document.write('<param name="menu" value="'+menu+'"/>');
	document.write('<param name="quality" value="high"/>');
	document.write('<param name="flashvars" value="'+flashvars+'"/>');
	document.write('<embed src="'+filename+'" wmode="'+wmode+'" menu="'+menu+'" quality="high" flashvars="'+flashvars+'" salign="'+salign+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+name+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>');
	document.write('</object>');
	return true;
}

function flash_innerHTML(version, filename, name, width, height, wmode, bgcolor, menu, flashvars, salign) {
	salign==false ? salign="lt":"";
	htmlText='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+width+'" height="'+height+'" id="'+name+'" align="middle">'
	+'<param name="allowScriptAccess" value="sameDomain"/>'
	+'<param name="allowFullScreen" value="true"/>'
	+'<param name="wmode" value="'+wmode+'"/>'
	+'<!-- Flash FIX v0.3 | www.mega.by -->'
	+'<param name="bgcolor" value="'+bgcolor+'"/>'
	+'<param name="salign" value="'+salign+'"/>'
	+'<param name="movie" value="'+filename+'"/>'
	+'<param name="menu" value="'+menu+'"/>'
	+'<param name="quality" value="high"/>'
	+'<param name="flashvars" value="'+flashvars+'"/>'
	+'<embed src="'+filename+'" wmode="'+wmode+'" menu="'+menu+'" quality="high" flashvars="'+flashvars+'" salign="'+salign+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+name+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
	+'</object>';
	return htmlText;
}

function getBrowserInfo() {
 	var t,v = undefined;
 	if (window.opera) t = 'Opera';
 	else if (document.all) {
  		t = 'IE';
  		var nv = navigator.appVersion;
  		var s = nv.indexOf('MSIE')+5;
  		v = nv.substring(s,s+1);
 	}
 	else if (navigator.appName) t = 'Netscape';
 	return {type:t,version:v};
}

function set_home_page(url,obj,text){
	var b = getBrowserInfo();
 	if (b.type == 'IE' ) { 
		obj.style.behavior='url(#default#homepage)';
		obj.sethomepage(url);
		return true;
 	} else  {
 		alert(text);
 		return false;
 	}
}


function bookmark(a,text){
	 var url = window.document.location;
 	var title = window.document.title;
 	var b = getBrowserInfo();
 	if (b.type == 'IE' && 7 > b.version && b.version >= 4) window.external.AddFavorite(url,title);
 	else if (b.type == 'Opera') {
  		a.href = url;
  		a.rel = "sidebar";
  		a.title = url+','+title;
  		return true;
 	}	
 	else alert(text);
 	return false;
}

function zoom(url, title, w, h) {
	zoomw=window.open("about:blank", "_blank", "width="+(w+20)+", height="+(h+20));
	zoomw.document.write("<html><head><title>"+title+"</title></head><body style='margin:0px; background:#ffffff;'>");
	zoomw.document.write("<center><table cellpadding='0' cellpading='0' width='100%' height='100%'><tr><td width='100%' height='100%' align='center' valign='middle'>");
	zoomw.document.write("<img src='"+url+"' width='"+w+"' height='"+h+"'>");
	zoomw.document.write("</td></tr></table>");
	zoomw.document.write("</center></body></html>");
}

function email(name, domain, tld, text, subject) {
	if(subject) {
	} else {
		subject='Письмо сайта limex.by';
	}
	if(text) {
		if(subject) {
			document.write('<a href="mailto:'+name+'@'+domain+'.'+tld+'?Subject='+subject+'">'+text+'</a>');
		} else {
		}
	} else {
		document.write('<a href="mailto:'+name+'@'+domain+'.'+tld+'?Subject='+subject+'">'+name+'@'+domain+'.'+tld+'</a>');
	}
}

function f_cart(id) {
	document.getElementById('product_id').value=id;
	document.getElementById('frm_cart').submit();
}
