// JavaScript Document
function sc(){
	var sURL = window.location;
	var sTitle = "佳龙电子";
	if(document.all)
		window.external.AddFavorite(sURL, sTitle); 
	else
		window.sidebar.addPanel(sTitle, sURL, "");	
}

function sy(){
	var sURL = "http://www.calonsw.com";
	var sTitle = "佳龙电子";
	if (document.all){
			document.body.style.behavior='url(#default#homepage)';
	  		document.body.setHomePage(sURL);
		}
	else if (window.sidebar){
		if(window.netscape){
			try{  
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			}  
			catch (e){  
				alert( "" );  
			}
		} 
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',sURL);
	 }
}

function init_contact(){
	var area = $("#areaInfo");
	var btn = $("#displayA");
	area.hide();
	btn.attr("className","showAll");
	
	btn.click( function(){
		if(area.is(":hidden")){
			area.fadeIn();
			btn.attr("className","closeAll");
		}else{
			area.fadeOut();
			btn.attr("className","showAll");
		}
	});
	
}

function init_product(){
	if(id == "0" || id=="" ){
	//return;
	}else{
		var o = "#li"+id;
		var a = "#a"+id;
		$(o).attr("class","act");
		$(a).attr("class","act");
	}
	
	var w = $(window).width();
	var h = $(window).height();
	var th=570,tw=882;
	if(h<650){
		th = h-60;
	}
	if(w < 900)
		tw = w-40;
	
	var url = "&KeepThis=true&TB_iframe=true&height="+th+"&width="+tw;
	
	$(".ibta").each(function(){
							 	var turl = $(this).attr("href");
								turl = turl.replace(/pshow.asp/g,"pshow2.asp");
								turl += url;
								$(this).attr("href",turl);
							 });
	//alert($(".ibta").attr("href"));
	tb_init($("a.ibta"));
}

function init_home(){
	$("#newsBar a").each(function(){
								  $(this).attr("class","noselect");
								  var ox = $(this).attr("name");
								  $("#"+ox).hide();
								  });
	$("#"+$("#newsBar a:first").attr("name")).show();
	$("#newsBar a:first").attr("class","select");
	
	$("#newsBar a").click(function(){
								   if($(this).attr("class") == "select")
									   	return false;
									else{
										//alert($("#newsBar a[alt='select']").attr("class"));
										var ox = $("#newsBar a[class=select]").attr("name");
										$("#newsBar a[class='select']").attr("class","noselect");
										$(this).attr("class","select");
										$("#"+ox).hide();
										$("#"+$(this).attr("name")).fadeIn();
										return false;
									}
									$(this).blur();
								   });
}


function init_cert(){
	var w = $(window).width();
	var h = $(window).height();
	var th=570,tw=882;
	if(h<650){
		th = h-60;
	}
	if(w < 900)
		tw = w-40;
	
	var url = "&KeepThis=true&TB_iframe=true&height="+th+"&width="+tw;
	
	$("#certUL a").each(function(){
							 	var turl = $(this).attr("href");
								//turl = turl.replace(/pshow.asp/g,"pshow2.asp");
								//turl += url;
								//$(this).attr("href",turl);
								//$(this).attr({className:"thickbox",rel:"gallery-plants"});
								$(this).attr("class","thickbox");
								//$(this).attr("rel","gallery-plants");
							 });
	//alert($(".ibta").attr("href"));
	tb_init($("#certUL a"));
}

