   onerror=function(){return true};
   var win=null;
   var curSkin="";
   var N;
   
   function setCookie (name,value,expires,path,theDomain,secure) { 
         var theCookie = name + "=" + escape (value) + 
         ((expires)    ? "; expires=" + expires.toGMTString() : "") + 
         ((path)       ? "; path="    + path   : "") + 
         ((theDomain)  ? "; domain="  + theDomain : "") + 
         ((secure)     ? "; secure"            : ""); 
         document.cookie = theCookie; 
      } 

   function getCookie(Name) { 
         var search = Name + "="; 
         if (document.cookie.length > 0) {
            offset = document.cookie.indexOf(search) 
            if (offset != -1) {
               offset += search.length 
               end = document.cookie.indexOf(";", offset) 
               if (end == -1) end = document.cookie.length 
               return unescape(document.cookie.substring(offset, end)) 
            } 
         } 
      } 
   
   
   function doSort(vcolumn){
	if (vcolumn == oSkinz.SortColumn)
	{
		oSkinz.SortAscending = !oSkinz.SortAscending;
	}
	else
	{
		oSkinz.SortColumn = vcolumn;
	}
	
	oSkinz.Reset();
  	update(true);
	}
   
   
   function clickHandle(){
   	el = event.srcElement.parentElement;
	if (!el || el.tagName!="A" )
		return;
	else
   		{
			if(el.href.indexOf(".dll")!=-1){
				navigate("UBskinz://f=" + el.href);
				setCookie("cS",el.href);
				return false;
			}
		}
   }
   
   function doPreview(el){
		dasrc=el.src;

	if(!win || win.closed)
	win=open( '' , 'win','width=400,height=296' );

	else if (win.open){
	win.close();
	win=open( '' , 'win','width=400,height=296' );
	}


	with(win.document){
		open();
		write("<html><head><title>Preview </title></head>"
			+ "<body onload='self.focus()' onclick='self.close()' bgcolor=#eeeeee topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><center><IMG  width=400 height=296 src='" + dasrc + "'></center></body></html>");
		close();
  	}
}
 
function update(wasreset,step){

	tot = oSkinz.recordset.recordCount;
	if(wasreset)
		N= Math.min(5,tot);
	else{
		oldN = oTDC.all.tags("tr")[oTDC.all.tags("tr").length-8].recordNumber;
		N =(step>0)? Math.min(oldN+5 , tot) :  Math.max(oldN-5 , 5);		
	}
	//update nav buttons
	document.all.next.className=document.all.next1.className = (tot-N>0)? "nav" : "nonav";
	document.all.prev.className=document.all.prev1.className = (N>5)? "nav" : "nonav";

}

function getPage(which){
	
	switch (which){
		case "next" :
			if (event.srcElement.className!="nonav")
				update(false,1);
				oTDC.nextPage();
			break;
			
		case "prev" :		
			if (event.srcElement.className!="nonav")
				update(false,-1);
				oTDC.previousPage();
			break;
	}
	
	cancelBubble=true;		
} 
   
   document.onclick=clickHandle;

