function set_cookie(name, value, expirehours, domain)
{
var today = new Date();
today.setTime(today.getTime() + (60*60*1000*expirehours));
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}
function mlink1() {location.href = "/sub03/01.php"; set_cookie("sub", 1, 365);}
function mlink2() {location.href = "/sub03/01.php"; set_cookie("sub", 2, 365);}
function mlink3() {location.href = "/sub03/01.php"; set_cookie("sub", 3, 365);}
function mlink4() {location.href = "/sub03/01.php"; set_cookie("sub", 4, 365);}
function get_cookie(name) {
var find_sw = false;
var start, end;
var i = 0;
for (i=0; i<= document.cookie.length; i++)
{
start = i;
end = start + name.length;
if(document.cookie.substring(start, end) == name)
{
find_sw = true
break
}
}
if (find_sw == true)
{
start = end + 1;
end = document.cookie.indexOf(";", start);
if(end < start)
end = document.cookie.length;
return document.cookie.substring(start, end);
}
return "";
}
var Cookies = document.cookie.split(";");
sub = get_cookie("sub");
if (sub=="1"){
$(".placetab").children("a").eq(0).addClass("active").siblings().removeClass("active");
$("#placecon" + sub).show().siblings(".placecon").hide();
}if (sub=="2"){
$(".placetab").children("a").eq(1).addClass("active").siblings().removeClass("active");
$("#placecon" + sub).show().siblings(".placecon").hide();
}if (sub=="3"){
$(".placetab").children("a").eq(2).addClass("active").siblings().removeClass("active");
$("#placecon" + sub).show().siblings(".placecon").hide();
}if (sub=="4"){
$(".placetab").children("a").eq(3).addClass("active").siblings().removeClass("active");
$("#placecon" + sub).show().siblings(".placecon").hide();
}
function delete_cookie(name) {
var today = new Date();
today.setTime(today.getTime() - 1);
var value = get_cookie(name);
if(value != "")
document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString();
}
delete_cookie("sub");