var g_oSP = null;SlidePanel = function(){	this.id = null;	this.timer = null;	this.PanelObj = null;	this.p_PanelObj = null;	this.is_show_panel = false;	this.speed = null;	this.rate = null;	this.oIFrame = null;	this.set_info = null;}; SlidePanel.prototype.Init = function(panel_id, p_panel_id, set_info){	/*g_oSP = this;*/	this.id = panel_id;	this.set_info = set_info;	this.speed = this.set_info.speed;	this.PanelObj = document.getElementById(panel_id);	this.p_PanelObj = document.getElementById(p_panel_id);	this.InsertPanelGuideline();};SlidePanel.prototype.SetStartLocation = function(){	switch (this.set_info.direct)	{		case 'Top':			this.PanelObj.style.top = -(this.PanelObj.style.pixelHeight);			this.PanelObj.style.left =0 ;			break;		case 'TopLeft':			this.PanelObj.style.top = -(this.PanelObj.style.pixelHeight);			this.PanelObj.style.left = -(this.PanelObj.style.pixelWidth);			break;		case 'TopRight':			this.PanelObj.style.top = -(this.PanelObj.style.pixelHeight);			this.PanelObj.style.left = this.PanelObj.style.pixelWidth;			break;		case 'Left':			this.PanelObj.style.top = 0;			this.PanelObj.style.left = -(this.PanelObj.style.pixelWidth);			break;		case 'Right':			this.PanelObj.style.top = 0;			this.PanelObj.style.left = this.PanelObj.style.pixelWidth;			break;		case 'Bottom':			this.PanelObj.style.top = this.PanelObj.style.pixelHeight;			this.PanelObj.style.left = 0;			break;		case 'BottomLeft':			this.PanelObj.style.top = this.PanelObj.style.pixelHeight;			this.PanelObj.style.left = -(this.PanelObj.style.pixelWidth);			break;		case 'BottomRight':			this.PanelObj.style.top = this.PanelObj.style.pixelHeight;			this.PanelObj.style.left = this.PanelObj.style.pixelWidth;			break;	}};SlidePanel.prototype.InsertPanelGuideline = function(){	var length = this.p_PanelObj.children.length;	var oLastChild = this.p_PanelObj.children(length - 1);		if(oLastChild.id != 'panel_guideline_'+this.id)	{		var panel_guideline_width = this.PanelObj.style.width;		var panel_guideline_height = this.PanelObj.style.height;		this.SetStartLocation();		this.rate = (parseInt(panel_guideline_height) / parseInt(panel_guideline_width));				var panel_guideline_HTML = '<div id="panel_guideline_'+this.id+'" style="position: absolute;z-index:120;overflow:hidden;width:'+panel_guideline_width+';height:'+panel_guideline_height+';border:0 solid red;margin:'+(20 + parseInt(this.set_info.top))+' 0 0 -'+(parseInt(panel_guideline_width) + parseInt(this.set_info.right))+';display:none;"></div>';		this.p_PanelObj.insertAdjacentHTML("beforeEnd",panel_guideline_HTML);		var panel_iframe = '<iframe id="panel_iframe_'+this.id+'" style="position: absolute;top:'+this.PanelObj.style.top+';left:'+this.PanelObj.style.left+';width:'+panel_guideline_width+';height:'+panel_guideline_height+';" frameborder=0 scrolling=no></iframe>';		document.getElementById("panel_guideline_"+this.id).innerHTML = panel_iframe;		this.oIFrame = document.getElementById('panel_iframe_'+this.id);		document.getElementById("panel_guideline_"+this.id).insertAdjacentElement("beforeEnd",this.PanelObj);	}};SlidePanel.prototype.RemovePanelGuideline = function(){	/*this.oIFrame.removeNode(true);*/	var length = this.p_PanelObj.children.length;	var oPanelGuideline = this.p_PanelObj.children(length - 1);	/*oPanelGuideline.removeNode(true);*/	oPanelGuideline.style.display='none';};SlidePanel.prototype.ShowPanel = function(){	g_oSP = this;	this.StopTimer();	if(this.is_show_panel == false)	{		document.getElementById("panel_guideline_"+this.id).style.display='inline';		this.PanelObj.style.display='inline';			if(this.timer == null)			this.timer=setInterval(eval('this.SlideShow_'+this.set_info.direct),1);				this.is_show_panel = true;	}else {		this.HideSlidePanel();	}};SlidePanel.prototype.SlideShow_Top = function(){	if(g_oSP.oIFrame.style.pixelTop < 0)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop + g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop + g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_TopLeft = function(){	if(g_oSP.PanelObj.style.pixelLeft < 0)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft + g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft + g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_TopRight = function(){	if(g_oSP.PanelObj.style.pixelLeft > 0)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft - g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft - g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_Left = function(){		if(g_oSP.PanelObj.style.pixelLeft < 0)	{		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft + g_oSP.speed;		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft + g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_Right = function(){		if(g_oSP.PanelObj.style.pixelLeft > 0 )	{		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft - g_oSP.speed;		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft - g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_Bottom = function(){	if(g_oSP.PanelObj.style.pixelTop > 0)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop - g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop - g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_BottomLeft = function(){	if(g_oSP.PanelObj.style.pixelLeft < 0)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft + g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft + g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_BottomRight = function(){		if(g_oSP.PanelObj.style.pixelLeft > 0)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft - g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft - g_oSP.speed;	}else {				g_oSP.SlideShow_Finish();	}};SlidePanel.prototype.SlideShow_Finish = function(){	this.StopTimer(); 	this.oIFrame.style.top = 0;	this.oIFrame.style.left = 0;	this.PanelObj.style.top = 0;	this.PanelObj.style.left = 0;};SlidePanel.prototype.StopTimer = function(){	if (this.timer != null)	{		clearInterval(this.timer);		this.timer = null;	}		};SlidePanel.prototype.HideSlidePanel = function(){	g_oSP = this;			if(this.timer == null)		this.timer=setInterval(eval('this.SlideHide_'+this.set_info.direct),1);		this.is_show_panel = false;};SlidePanel.prototype.SlideHide_Top = function(){	if(g_oSP.PanelObj.style.pixelTop > -(g_oSP.PanelObj.style.pixelHeight))	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop - g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop - g_oSP.speed;	}else {		g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_TopLeft = function(){	if(g_oSP.PanelObj.style.pixelLeft > -(g_oSP.oIFrame.style.pixelWidth))	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft - g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft - g_oSP.speed;	}else {		g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_TopRight = function(){	if(g_oSP.PanelObj.style.pixelLeft < g_oSP.PanelObj.style.pixelWidth)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft + g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop - parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft + g_oSP.speed;	}else {		g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_Left = function(){		if(g_oSP.PanelObj.style.pixelLeft > -(g_oSP.PanelObj.style.pixelWidth))	{		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft - g_oSP.speed;		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft - g_oSP.speed;	}else {				g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_Right = function(){		if(g_oSP.PanelObj.style.pixelLeft <  g_oSP.PanelObj.style.pixelWidth )	{		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft + g_oSP.speed;		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft + g_oSP.speed;	}else {				g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_Bottom = function(){		if(g_oSP.PanelObj.style.pixelTop < g_oSP.PanelObj.style.pixelHeight)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop + g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop + g_oSP.speed;	}else {		g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_BottomLeft = function(){		if(g_oSP.PanelObj.style.pixelLeft > -(g_oSP.PanelObj.style.pixelWidth))	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft - g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft - g_oSP.speed;	}else {				g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_BottomRight = function(){	if(g_oSP.PanelObj.style.pixelLeft < g_oSP.PanelObj.style.pixelWidth)	{		g_oSP.oIFrame.style.top = g_oSP.oIFrame.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.oIFrame.style.left = g_oSP.oIFrame.style.pixelLeft + g_oSP.speed;		g_oSP.PanelObj.style.top = g_oSP.PanelObj.style.pixelTop + parseInt(g_oSP.rate * g_oSP.speed);		g_oSP.PanelObj.style.left = g_oSP.PanelObj.style.pixelLeft + g_oSP.speed;	}else {				g_oSP.SlideHide_Finish();	}};SlidePanel.prototype.SlideHide_Finish = function(){	g_oSP.StopTimer();	g_oSP.PanelObj.style.display='none';	g_oSP.RemovePanelGuideline();};