function resetFrame(height){
  var id = "myshop_list";
  var obj= parent.document.getElementById(id);
  if (document.all)
	   window.resizeTo(document.body.scrollWidth,height);
  else
	obj.style.height=height+"px";
}

function setHeight(iframe_name,iframe_height){
	document.getElementById(iframe_name).height=iframe_height;
}
function getHeight(end_name){
	return document.getElementById(end_name).offsetTop;
}

function SetCookie (name, value) { //?????name,??value?Cookie
var argc = SetCookie.arguments.length;
var argv = SetCookie.arguments;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
var exp = new Date();
exp.setTime (exp.getTime() + 1000*10);
document.cookie = name + "=" + value +
"; path=/" +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "") +
"; expires=" + exp.toGMTString();
}

function Deletecookie (name) { //?????name?Cookie
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function Clearcookie() //??COOKIE
{
var temp=document.cookie.split(";");
var loop3;
var ts;
for (loop3=0;loop3<temp.length;loop3++)
{
ts=temp[loop3].split("=")[0];
if (ts.indexOf('redirecturl')!=-1)
DeleteCookie(ts); //??ts??redirecturl??????
}
}

function getCookieVal (offset) { //??????offset?cookie?
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) { //?????name?cookie?
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}

if(top.location==self.location){
	var url = self.location.href;
	//alert(url.substring(url.indexOf('?')-16,url.indexOf('?'))))
	  if(  
           url!='http://192.168.1.100'&&	   
	   url!='http://192.168.1.100/'&&
	   url.substring(url.length-15,url.length)!='index/index.jsp'&&
	   url.substring(url.length-6,url.length)!='index/'&&
	   url.substring(url.length-9,url.length)!='index.jsp'&&
	   url.substring(url.length-9,url.length)!='index.htm'&&
	   url.substring(url.indexOf('?')-16,url.indexOf('?'))!='manage/index.jsp'&&
	   url.substring(url.length-21,url.length)!='selfhelp/selfhelp.htm'&&
	   url.substring(url.length-21,url.length)!='selfhelp/selfhelp.htm'&&
	   url.substring(url.length-20,url.length)!='background/index.htm'&&
	   //url.substring(url.length-19,url.length)!='memorial/search.jsp'&&
	   url.substring(url.length-19,url.length)!='template1/index.jsp'&&
	   url.substring(url.length-19,url.length)!='template2/index.jsp'&&
	   url.substring(url.length-24,url.length)!='functional/sacrifice.jsp'&&
	   url.substring(url.length-28,url.length)!='memorial/obc_common_list.jsp'&&
	   url.substring(url.length-19,url.length)!='memory_01/index.htm'&&
	   url.substring(url.length-20,url.length)!='memory_01/memory.jsp'&&
	   url.substring(url.length-21,url.length)!='memory_01/memory2.htm'&&
	   url.substring(url.length-19,url.length)!='memory_01/jnwx1.htm'&&
	   url.substring(url.length-19,url.length)!='memory_01/hdnp1.htm'&&
	   url.substring(url.length-19,url.length)!='memory_01/yrxm1.htm'&&
	   url.substring(url.length-19,url.length)!='memory_01/sply1.htm'&&
	   url.substring(url.length-19,url.length)!='memory_01/qnly1.htm'&&
	   url.substring(url.length-21,url.length)!='memory_01/server1.htm'&&
	   url.indexOf('memorial/search.jsp')<0&&
	   url.indexOf('/produce/')<0&&
	   url.indexOf('/servicelogic/')<0&&
	   url.indexOf('help')<0
	   ){
	SetCookie("redirecturl",self.location);
	//alert(GetCookie("redirecturl"));
	self.location = "/index/index.jsp";
	}
}
