// JavaScript Document
/*
function getscrollwindow(){
	if (document.documentElement && document.documentElement.scrollTop){
		// IE6 +4.01 and user has scrolled
		temp=document.documentElement.scrollTop;
	}else{
		if (document.body && document.body.scrollTop){
			// IE5 or DTD 3.2
			temp=document.body.scrollTop;
		}
	}
	
	if (!document.all) temp=window.pageYOffset;
	return temp;
}
*/
/*
function addscroll(url){
	if(url.indexOf('coditm=',0)!=-1){
		url = url+'&scroll='+getscrollwindow();
	}else{
		url = url+'/'+getscrollwindow();
	}
	return url;
}
*/
function SaveScroll(){
  if (document.documentElement && document.documentElement.scrollTop){
    // IE6 +4.01 and user has scrolled
    temp=document.documentElement.scrollTop;
  }else{
    if (document.body && document.body.scrollTop){
      // IE5 or DTD 3.2
      temp=document.body.scrollTop;
    }
  }
  if (!document.all) temp=window.pageYOffset;
  
  var exp = new Date();
  exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24));
  
  setCookie('myScrollCookie',temp, exp);
}
function SetScroll(){
  temp=getCookie('myScrollCookie');
  if(temp!='' && temp!=null){
    alert('scroll');
    alert(temp);
    window.scrollTo(0, temp);
    delCookie('myScrollCookie');
  }
}
function getCookie(name) {
  var dc = document.cookie;
  var cname = name + "=";
  if (dc.length > 0) {
    begin = dc.indexOf(cname);
    if (begin != -1) {
      begin += cname.length;
      end = dc.indexOf(" ", begin);
      if (end == -1) end = dc.length;
      return unescape(dc.substring(begin, end));
      }
    }
  return null;
}
function setCookie(name, value, expires) {
  document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString());
}
function delCookie(name) {
document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT" + "; path=/";
}
window.onload=SetScroll;
