// JavaScript Document
//Written By Asimplefire
//2009-10-22

//menu bg switch
$(document).ready(function(){
						   $("#ul_nav li a").mouseover(function(){
																if($(this).text().length==4){$(this).addClass("onA_liCell_86")}else if($(this).text().length>6){$(this).addClass("onA_liCell_104")};																	
																	});
						   $("#ul_nav li a").mouseout(function(){
																if($(this).text().length==4){$(this).removeClass("onA_liCell_86")}else if($(this).text().length>6){$(this).removeClass("onA_liCell_104")};																
																});
						   $("#barBodyLeft ul li b").mouseover(function(){$("#barBodyLeft ul li").removeClass("onLiChange"); $("#barBodyLeft ul li").addClass("barBodyLeft_ul_li");$(this).parent().addClass("onLiChange");									
																	for(var i=1;i<5;i++){$("#pb"+i).hide();}
																	$("#p"+$(this).attr("id")).show();
																	});	
							for(var i=1;i<5;i++){$("#pb"+i).hide();}	$("#pb1").show();	
							//为广告banner2添加一个链接							
							$(".briefBanner").click(function(){open("http://www.ccseo.net/articles/Show-211.html","_self")});
							})

// the type of png pic transparent for IE6
function enablePngImages() {
 var imgArr = document.getElementsByTagName("IMG");
 for(i=0; i<imgArr.length; i++){
  if(imgArr[i].src.toLowerCase().lastIndexOf(".png") != -1){
   imgArr[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgArr[i].src + "', sizingMethod='auto')";
   imgArr[i].src = "http://www.ccseo.net/images/spacer.gif";
  }
  
  if(imgArr[i].currentStyle.backgroundImage.lastIndexOf(".png") != -1){
   var img = imgArr[i].currentStyle.backgroundImage.substring(5,imgArr[i].currentStyle.backgroundImage.length-2);
   imgArr[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
   imgArr[i].style.backgroundImage = "url(images/spacer.gif)";
  }
 }
}

function enableBgPngImages(){
 var bgElements=document.getElementsByTagName("DIV");
 for(i=0; i<bgElements.length; i++){
  if(bgElements[i].currentStyle.backgroundImage.lastIndexOf(".png") != -1&&bgElements[i].currentStyle.backgroundRepeat!="repeat-x"){
   //alert(bgElements[i]);
   var img = bgElements[i].currentStyle.backgroundImage.substring(5,bgElements[i].currentStyle.backgroundImage.length-2);
   bgElements[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
   bgElements[i].style.backgroundImage = "url(http://www.ccseo.net/images/spacer.gif)";
  }
 }
}

function transparentAllPng(){enablePngImages();enableBgPngImages();}
window.attachEvent("onload", transparentAllPng);

