function DialogShow(dialogid){
	$('#'+dialogid).dialog({
		autoOpen: false,
		bgiframe: true,
		height: 600,
		width: 780,
		modal: true
	});
	if(dialogid=='dialog1'){
		frameLoad('dialog1Frame','?OP=mailbox');
	}else{
		frameLoad('dialog2Frame','?OP=wx');
	}
	$('#'+dialogid).dialog("open");
}
function frameLoad(id,url){
	if(!$('#'+id).attr('src')){
		$('#'+id).attr('src',url);
	}
}
TabsComponent=function(){
	var oComponent=this;
	var oDefConfig={
		sTabHeader:".productCycleTab",
		sTabBox:".productCycleItem",
		sSwitchEvent:"mouseover",
		sCurrentTab:"current"
	}
	var aTabs,aItems;
	var currentIndex=0;
	var dataLength;
	oComponent.init=function(oConfig){
		(typeof(oConfig.sTabHeader)=='undefined')?null:oDefConfig.sTabHeader=oConfig.sTabHeader;
		(typeof(oConfig.sTabBox)=='undefined')?null:oDefConfig.sTabBox=oConfig.sTabBox;
		(typeof(oConfig.sSwitchEvent)=='undefined')?null:oDefConfig.sSwitchEvent=oConfig.sSwitchEvent;
		(typeof(oConfig.sCurrentTab)=='undefined')?null:oDefConfig.sCurrentTab=oConfig.sCurrentTab;

		aTabs=$(oDefConfig.sTabHeader);
		aItems=$(oDefConfig.sTabBox);
		dataLength=Math.min(aTabs.length,aItems.length);
		var event=function(){
				for(var t=0;t<dataLength;t++){
					if(aTabs[t]==this){
						currentIndex=t;
						break;
					}
				}
				aTabs.removeClass(oDefConfig.sCurrentTab);
				aItems.hide();
				
				$(aTabs[currentIndex]).addClass(oDefConfig.sCurrentTab);
				$(aItems[currentIndex]).show();
			};
		for(var i=0;i<dataLength;i++){
			if(oDefConfig.sSwitchEvent=="mouseover"){
				$(aTabs[i]).mouseover(event);
			}else{
				$(aTabs[i]).click(event);
			}
			if($(aTabs[i]).hasClass(oDefConfig.sCurrentTab)){
				currentIndex=i;
			}
		}
		//隐藏
		aTabs.removeClass(oDefConfig.sCurrentTab);
		aItems.hide();
		$(aTabs[currentIndex]).addClass(oDefConfig.sCurrentTab);
		$(aItems[currentIndex]).show();
	}
}