if(window.ActiveXObject){
   document.execCommand("BackgroundImageCache",false,true);
}
window.setTimeout("gotoIndex",1*1000*30*60);
function gotoIndex(){
	window.location.href="/store/index.html";
}
//create the httprequest obj.
function createHttpRequest(){
   var http_request = false;
   if(window.ActiveXObject){ // IE 
   	   	try {
           http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
           try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
   }
   else if(window.XMLHttpRequest){ //Mozilla 
   	   	http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) {//MiME 
           http_request.overrideMimeType("text/xml");
        }
   }
   if(!http_request){ return false; }
   else return http_request;
}
//number check
function checknum(p){
	if(trim(p)=="")return false;
    var l = p.length;
    var count=0; 
    for(var i=0; i<l; i++) { 
       var digit = p.charAt(i); 
       if(digit == "." ) { 
             ++count; 
             if(count>1) {
			    //alert ("input data"); 
                return false; 
             } 
        } 
        else if(digit < "0" || digit > "9") {
        	//alert ("input data");
           return false; 
        } 
     } 
    return true; 
}
//for IE7 And FF window.event.keyCode
function keepKeyNum(e)
{
	 var code = -1;
   if (!e) var e = window.event
   if (e.keyCode) code = e.keyCode;
   else if (e.which) code = e.which;
   
   return code;
}
String.prototype.replaceAll  = function(s1,s2){    
	return this.replace(new RegExp(s1,"gm"),s2);    
}
String.prototype.endWith=function(oString){  
	var   reg=new   RegExp(oString+"$");  
	return   reg.test(this);     
}  
//for Firefox DOM add innerText attribute
var lBrowser = {};
lBrowser.agt = navigator.userAgent.toLowerCase();
lBrowser.isW3C = document.getElementById ? true:false;
lBrowser.isIE = ((lBrowser.agt.indexOf("msie") != -1) && (lBrowser.agt.indexOf("opera") == -1) && (lBrowser.agt.indexOf("omniweb") == -1));
lBrowser.isNS6 = lBrowser.isW3C && (navigator.appName=="Netscape") ;
lBrowser.isOpera = lBrowser.agt.indexOf("opera") != -1;
lBrowser.isGecko = lBrowser.agt.indexOf("gecko") != -1;
lBrowser.ieTrueBody =function (){
  return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
};

if(lBrowser.isNS6){ //firefox innerText define
  HTMLElement.prototype.__defineGetter__( "innerText", 
  function(){ 
  return this.textContent; 
  } 
  ); 
  HTMLElement.prototype.__defineSetter__( "innerText", 
  function(sText){ 
  this.textContent=sText; 
  } 
  ); 
}
function RemoveArray(array,attachId)
{
    for(var i=0,n=0;i<array.length;i++)
    {
        if(array[i]!=attachId)
        {
            array[n++]=array[i]
        }
    }
    array.length -= 1;
}
Array.prototype.remove = function (obj) {
    return RemoveArray(this,obj);
};
function trim(str){
	return str.replace(/(^\s*)|(\s*$)/g, "");
}
function findcomXY(o){
    var to=new Object();
	to.left=to.right=to.top=to.bottom=0;
	var twidth=o.offsetWidth;
	var theight=o.offsetHeight;

	while(o!=null&&o!=document.body){
		to.left+=o.offsetLeft;
		to.top+=o.offsetTop;
		o=o.offsetParent;
	}
	to.right=to.left+twidth;
	to.bottom=to.top+theight;
	return to;	
}
//limit Char count
//id: textarea id
//count: 
//use: <textarea id="mytext" cols="" rows="" onkeydown="limitChars('mytext', 120)" onchange="limitChars('mytext', 120)" onpropertychange="limitChars('mytext', 120)"></textarea>
function limitChars(id, count, filter_str){
    var obj = document.getElementById(id);
    var val = obj.value;
    if(typeof(filter_str)!="" && filter_str!=null && trim(filter_str)!=""){
    	val = val.replaceAll(filter_str,"");
    }
    if (val.length > count){   
    	val = val.substr(0, count);   
    }
    return val.length;
}
//*
function accMul(arg1,arg2){ 
	var m=0,s1=arg1.toString(),s2=arg2.toString(); 
	try{m+=s1.split(".")[1].length;}catch(e){} 
	try{m+=s2.split(".")[1].length;}catch(e){} 
	return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
}
//  /
function accDiv(arg1,arg2){ 
	var t1=0,t2=0,r1,r2; 
	try{t1=arg1.toString().split(".")[1].length;}catch(e){} 
	try{t2=arg2.toString().split(".")[1].length;}catch(e){} 
	with(Math){ 
		r1=Number(arg1.toString().replace(".","")); 
		r2=Number(arg2.toString().replace(".",""));
		return (r1/r2)*pow(10,t2-t1); 
	} 
}
//+
function accAdd(arg1,arg2){ 
	var r1,r2,m; 
	try{r1=arg1.toString().split(".")[1].length;}catch(e){r1=0;} 
	try{r2=arg2.toString().split(".")[1].length;}catch(e){r2=0;} 
	m=Math.pow(10,Math.max(r1,r2));
	return (arg1*m+arg2*m)/m ;
}
//-
function Subtr(arg1,arg2){
    var r1,r2,m,n;
    try{r1=arg1.toString().split(".")[1].length;}catch(e){r1=0;}
    try{r2=arg2.toString().split(".")[1].length;}catch(e){r2=0;}
    m=Math.pow(10,Math.max(r1,r2));
    //last modify by deeka
    //control the string length
    n=(r1>=r2)?r1:r2;
    return ((arg1*m-arg2*m)/m).toFixed(n);
}
function forDight(Dight,How){  
   var _dight  =  Math.round(Dight*Math.pow(10,How))/Math.pow(10,How);  
   return _dight;  
}
function isTodo(altext){
   var tudoDlog = window.confirm(altext);
   if(!tudoDlog) return false;
   else return true;
}