﻿// JScript File
function checkTextValue(textValue,maxLength)
{
    if(textValue.length>maxlength)
    {
        return "1";
    }
    
    var filterCode="a|b|c";
    var filterArr=filterCode.split("|");
    for(var i=0;i<filterArr.length;i++)
    {    
        if(textValeu.indexOf(filterArr[i])>0)
        {
            return "2";
        }
    }
    
    return "0";
}


			                        
function saveOrder(orderby,order,viewtype)
{
    var myCookie = new CookieClass();
	var viewtypeb = document.getElementById("goto").value;
	var orderbyb =  document.getElementById("sortdirection").value;
	var sortbyb  = document.getElementById("sortby").value;
    myCookie.setCookie("TL_neworderby", orderbyb);
	myCookie.setCookie("TL_newsortby", sortbyb);
    myCookie.setCookie("TL_newviewby", viewtypeb); 
    //myCookie.showCookie();
    document.getElementById("msgSaveSetting").style.display = "block";
}			                        

function GotoBookDeatils(category)
{
    var myCookie = new CookieClass();
    if(myCookie.getCookie("TL_newviewby")!="Cover")
    {
        window.location="book_details.asp?category="+category;
    }
    else
    {
        window.location="tumblenow.asp?category="+category;
    }
}

function GotoNewBookDeatils(category)
{
    var myCookie = new CookieClass();
    if(myCookie.getCookie("TL_newviewby")!="Cover")
    {
        window.location="newbook_details.asp?category="+category;
    }
    else
    {
        window.location="newbooktumblenow.asp?category="+category;
    }
}
