// JavaScript Document
delete(Object.prototype.toJSONString);
String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ""); };




function fbs_click() {
	RightNow = new Date();
	u =	location.href+'?t='+RightNow.getMonth()+RightNow.getDate()+RightNow.getHours()+RightNow.getMinutes()+RightNow.getSeconds();
	//u = "www.firstbank.com.tw/loan/lohas/story.html"
	//u ="http://epson.kehch.com/test2/";
	//u = "http://kt1.kehch.com/Allen_Test/test2";
	//u = "http://epson.kehch.com/EpsonTagsMachine/index.htm";
	//u="http://w3.epson.com.tw/epson/event/201012-lw/index.html";
	//t = document.title;
	//window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u),'sharer','toolbar=0,status=0,width=626,height=436');
}

function fbs_clickVar() {
	RightNow = new Date();
	u =	location.href+'&t='+RightNow.getMonth()+RightNow.getDate()+RightNow.getHours()+RightNow.getMinutes()+RightNow.getSeconds();
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u),'sharer','toolbar=0,status=0,width=626,height=436');
}
function fbs_index() {
	RightNow = new Date();
	u =	'http://www.fe-amart.com.tw?t='+RightNow.getMonth()+RightNow.getDate()+RightNow.getHours()+RightNow.getMinutes()+RightNow.getSeconds();
	t = document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
}

function twt_click(){
	u =	location.href;
	t = document.title;
	window.open('http://twitter.com/home/?status='.concat(encodeURIComponent(t)) .concat(' ') .concat(encodeURIComponent(u)));
}
function twt_index(){
	RightNow = new Date();
	u =	'http://www.fe-amart.com.tw?t='+RightNow.getMonth()+RightNow.getDate()+RightNow.getHours()+RightNow.getMinutes()+RightNow.getSeconds();
	t = document.title;
	window.open('http://twitter.com/home/?status='.concat(encodeURIComponent(t)) .concat(' ') .concat(encodeURIComponent(u)));
}

function puk_click(){
	u =	location.href;
	t = document.title;
	window.open('http://www.plurk.com/?qualifier=shares&status=' .concat(encodeURIComponent(u)) .concat(' ') .concat('&#40;') .concat(encodeURIComponent(t)) .concat('&#41;'));
}
function puk_index(){
    t =document.title;
	RightNow = new Date();
	u =	'http://www.fe-amart.com.tw?t='+RightNow.getMonth()+RightNow.getDate()+RightNow.getHours()+RightNow.getMinutes()+RightNow.getSeconds();
	window.open('http://www.plurk.com/?qualifier=shares&status=' .concat(encodeURIComponent(u)) .concat(' ') .concat('&#40;') .concat(encodeURIComponent(t)) .concat('&#41;'));
}

function GetValue()   
{   
    try{
    var arg= "PageSize"+"=";
    var GetStr = "";
    var GetStrArr = new Array();
    var PutStr = "";
    var obj = document.getElementsByName("Code");   
    var str="";
            
    if(document.cookie.length>0)
    {
    //alert('test1');
        var c_list = document.cookie.split("\;");
        for(i in c_list)
        {
            var cook = c_list[i].split("=");
            if(cook[0] == "PageSize")
            {
                GetStr = unescape(cook[1]);
            }
            else
            {
                GetStr = "";
            }
        }
    }
    else
    {
        GetStr = "";
    }
    //alert(GetStr);
    for(var i=0; i<obj.length; i++ ) {
    //alert('test2'+obj[i].value);
        if(obj[i].checked==true){
            GetStr = replaceAll(GetStr, obj[i].value+",", "");
            GetStr += obj[i].value+",";
        }
        else{
            GetStr = replaceAll(GetStr, obj[i].value+",", "");
        }
    }
    
    //alert(GetStr);
    document.cookie = "PageSize"+"="+GetStr;
    }
    catch(e){
        //alert(e.message);
    }
}   
function replaceAll(strOrg,strFind,strReplace){
         var index = 0;
         while(strOrg.indexOf(strFind,index) != -1){
              strOrg = strOrg.replace(strFind,strReplace);
              index = strOrg.indexOf(strFind,index);
         }
        return strOrg
} 
