max_recent=4
var expDays=30
var exp=new Date()
exp.setTime(exp.getTime()+(expDays*24*60*60*1000))
function getCookieVal(offset){
var endstr=document.cookie.indexOf(";",offset)
if(endstr==-1)endstr=document.cookie.length
return unescape(document.cookie.substring(offset,endstr))
}
function GetCookie(name){
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
}
function SetCookie(name,value){
var argv=SetCookie.arguments
var argc=SetCookie.arguments.length
var expires=(argc>2)?argv[2]:null
var path=(argc>3)?argv[3]:null
var domain=(argc>4)?argv[4]:null
var secure=(argc>5)?argv[5]:false
document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"")
}
function set_recent(v){
var r=new Array()
var i=1,j=1
while((r[i]=GetCookie('recent'+j))!=null&&r[i]!=""&&j++<=max_recent)
if(r[i]!=v)
i++
if(i>max_recent)
i=max_recent
SetCookie('recent'+i,v,exp,'/')
j=i
while(++j<=max_recent)
SetCookie('recent'+j,"",exp,'/')
j=0
if(i==max_recent&&r[i]!=null&&r[i]!="")
j=1
while(--i>0)
SetCookie('recent'+i,r[i+j],exp,'/')
}
function recent_items(bf,sp,bh){
var i=1,t="",n=""
if((n=GetCookie('recent'+i))!=null&&n!="")
t+=n
while(++i<=max_recent)
if((n=GetCookie('recent'+i))!=null&&n!="")
t+=sp+n
if(t!="")
document.write(bf+t+bh)
}

function ClearError() {
window.status = "Done";
return true;
}

window.onerror = ClearError;
// Function For Click to Enlarge
function viewimg(n, img, w, h){
  foto1= new Image();
  foto1.src=(img);
  viewFotos(n, img, w, h);

}

function viewFotos(name, img, w, h){
features = 
    "toolbar=no,location=no,directories=no,status=no,menubar=no," +
    "scrollbars=yes,resizable=yes,width=" + 500 + ",height=" + 600;
 dlg = window.open ("","Details",features);
 dlg.document.write("<html><head><title>" + name + " Zoom</title></head>");
 dlg.document.write("<body bgcolor=white><center>"); 
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<table width=100% height=100%>");
 dlg.document.write("<tr><td align=center valign=middle>");
 //dlg.document.write("<b><font style='font-family: arial, verdana, tahoma, helvetica; font-size: 12px; font-weight: bold'>" +  name + "</font></b><br><br>");
 dlg.document.write("<img src=" + img + ">");
 dlg.document.write("</td></tr>");
 dlg.document.write("<tr><td align=center valign=middle>");
 dlg.document.write("<a href=# onClick=window.close();>");
 dlg.document.write("<font size=1 face=verdana>click to close</font></a>");
 dlg.document.write("</td></tr>");
 dlg.document.write("</table></body></html>");
}
// Function for popup Mail to friend box
function tellafriend(mypage,w,h){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable'
win = window.open(mypage,'',settings)
}
function PopWin(theURL,winName,features, myWidth, myHeight, isCenter) { 
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/40;
    var myTop = (screen.height-myHeight)/40;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
  }
  window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}