function addFavorite() {
	var url = location.href;
	var title = document.title;
	var desc = "豪宅别墅信息网";
	if (document.all) {//IE 
		window.external.AddFavorite(url, title);
	} else if ((typeof window.sidebar == 'object')
			&& (typeof window.sidebar.addPanel == 'function')) {
		window.sidebar.addPanel(title, url, desc);
	}
}
function addhomepage() {
	var url = location.href;
	if (document.all) {
		this.homepage.style.behavior = 'url(#default#homepage)';
		this.homepage.sethomepage(url);
	} else if (window.netscape) {
		try {
			netscape.security.PrivilegeManager
					.enablePrivilege("UniversalXPConnect");
		} catch (e) {
			alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
		}
	}

	var prefs = Components.classes['@mozilla.org/preferences-service;1']
			.getService(Components.interfaces.nsIPrefBranch);
	prefs.setCharPref('browser.startup.homepage', url);
}

function switchTab(identify, index, count) {
	for (i = 0; i < count; i++) {
		var CurTabObj = $("#Tab_" + identify + "_" + i);
		var CurListObj = $("#List_" + identify + "_" + i);

		if (i != index) {
			CurTabObj.removeClass("upH3");
			CurListObj.removeClass("upBox");
		}
	}
	$("#Tab_" + identify + "_" + index).addClass("upH3");
	$("#List_" + identify + "_" + index).addClass("upBox");
}

/************************
 * jquery
 * 函数名： changeClass
 * 作     用： 改变一个dom节点的 class 属性，并且移除其它已有的属性
 * 参     数：identity   ---是节点的id 
 * 		   className  ---是css样式的名字
 * 无返回值 
 * ***********************/

function changeClass(identity, className) {
	var o = $("#" + identity);
	o.removeClass();
	o.addClass(className);
}
/*************
 * jquery
 * 函数名： glidePicture
 * 作  用：
 * 参  数： identity -----string 被改变图象id  jquery  选择器形式
 * 		    eventObject --string 触发事件的对象 this
 * 			imgsrc -------string 图片的地址。
 *****************************/
function glidePicture(identity, imgsrc, EventObject) {
	var bigImg = $(identity);
	var a_bigImg = bigImg.attr("parentNode");
	a_bigImg.title = EventObject.title;
	a_bigImg.href = EventObject.href;
	bigImg.attr("title", EventObject.title);
	bigImg.attr("src", imgsrc);
}

function writeFlash(src, w, h) { //输出flash
	var w = w;
	var h = h;
	var flash = "<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='"
			+ w
			+ "' height='"
			+ h
			+ "'><param name='movie' value='"
			+ src
			+ "' /><param name='wmode' value='opaque'><param name='quality' value='high' /><embed src='"
			+ src
			+ "' quality='high' wmode='opaque' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"
			+ w + "' height='" + h + "'></embed></object>";
	document.write(flash);
}
