//var BROWSER = {};
//var USERAGENT = navigator.userAgent.toLowerCase(); // 读出浏览器 得出和浏览器版本号
//BROWSER.ie = window.ActiveXObject && USERAGENT.indexOf('msie') != -1 && USERAGENT.substr(USERAGENT.indexOf('msie') + 5, 3);

//if(BROWSER.ie == '6.0' || BROWSER.ie == '5.5')
//{
//}

var url=window.location.href;
if(window!=parent&&url.indexOf("bbs")==-1)
	parent.navigate(url);

function showFlash(showId,flashSrc,flashW,flashH){
	$('#'+showId).get(0).innerHTML='<embed src="'+flashSrc+'" height="'+flashH+'" width="'+flashW+'" wmode="transparent" type="application/x-shockwave-flash"></embed>';
}

//js调flash去虚线.
function insert_flash(url,width,height,param){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'">\n');
    document.write('<param name="movie" value="'+url+'" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="wmode" value="opaque">\n');
	document.write('<param name="wmode" value="transparent" />\n');
	if(param != '')	document.write('<param name="FlashVars" value="bcastr_config='+param+'">\n');
	document.write('<embed src="'+url+'" quality="high" allowFullScreen="true" ');
	if(param != '') document.write(' FlashVars="bcastr_config='+param+'" ');
	document.write(' pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" wmode="opaque" wmode="transparent"></embed>\n');
document.write('</object>\n');
}

function showArtTab(id)
{
	var title	= "art_"+id;
	var obj		= document.getElementById($title);
	obj.className	= "s";
	for(var i=0;i<6;i++)
	{
		var oid	= "artcon_"+i;
		var oj	= document.getElementById(oid);
		if(i != id)
		{
			oj.className = "sd";	
		}
	}
}


// Index Article Show Type List;
function showIndexArtCont(url,tid,ii,count){
	$('#thisartcon').html("<img src='/images/loading.gif'>");

		for(var i = 1;i<=count;i++){
			$('#articletag_'+i).css({color: "#fff"});
		}

	$.post(url,
		   {tid:tid},
		   function(txt){
			   $('#thisartcon').html(txt);
			   $('#thisartcon').slideDown("slow");
			   $('#articletag_'+ii).css({color: "#F9C"});
			});	
}

// Index Article Show News Coontent;
function showIndexArtContect(tid){
	$('#thisartcon').html("<img src='/images/loading.gif'>");
	$.post('ajax.php?action=SIArticle',
		   {tid:tid},
		   function(txt){
			   $('#thisartcon').html(txt);
			   $('#thisartcon').slideDown("slow");
			});	
}

// Works List;
function showworks(url,id,tid){
	$('#thisworksarea').html("<img src='/images/loading.gif'>");
	for(var i = 1;i<=4;i++){
		$('#wordid_'+i).css({color: "#fff"});
	}
	$.post(url,
		   {id:id,tid:tid},
		   function(txt){
			   $('#thisworksarea').html(txt);
			   $('#thisworksarea').slideDown("slow");
			   $('#wordid_'+tid).css({color: "#F9C"});
			});
}


//

function Newslist(tid)
{
	$('#Newslists').html("<img src='/images/loading.gif'>");
	$.post('ajax.php?action=Newslist',
		   {tid:tid},
		   function(txt){
			   $('#Newslists').html(txt);
			   $('#Newslists').slideDown("slow");
			});
}



// show Price;
function showPrice(url,id,ii,count){
	$('#thisartcon').html("<img src='/images/loading.gif'>");
	for(var i = 1;i<=count;i++){
		$('#pricetag_'+i).css({color: "#fff"});
	}
	$.post(url,
		   {id:id},
		   function(txt){
			   $('#thisartcon').html(txt);
			   $('#thisartcon').slideDown("slow");
			   $('#pricetag_'+ii).css({color: "#F9C"});
			});
}



var max_obj = 5;
var p = 0;
function checkbox(obj) {
if(obj.checked) {
p++;
for (var i = 0; i < $('poll').elements.length; i++) {
var e = $('poll').elements[i];
if(p == max_obj) {
if(e.name.match('pollanswers') && !e.checked) {
e.disabled = true;
}
}
}
} else {
p--;
for (var i = 0; i < $('poll').elements.length; i++) {
var e = $('poll').elements[i];
if(e.name.match('pollanswers') && e.disabled) {
e.disabled = false;
}
}
}
$('pollsubmit').disabled = p <= max_obj && p > 0 ? false : true;
}

// NavTop
function expm(n){
	for(var i=1;i<=7;i++){
		$("#xs_"+i).removeClass();
	}
	$("#xs_"+n).addClass("ok");
}

