var newWin = null;
function selectAuthor()
{      
window.focus();
if (document.form1.authorSelect.value == 'all') 
   {
    window.location = "booksSelectPage.jsp";
   }
else
   {
    window.location = "booksSelectPage.jsp?sc=0&co=byauthor&authorName=" + document.form1.authorSelect.value;
   }
return false;
}

function quickCommentBook(title)
{
var windowParams = "width=400,height=185,resizable=no,scrollbars=no,left=400,top=300";
var zoomUrl = "http://www.lanka.info/feedBack/quickCommentsCD.html?" + title + " or generally about Sinhala books at Kapruka";
newWin = window.open(zoomUrl,"Popup",windowParams);
}

function showFAQ()
{
var windowParams = "width=680,height=600,resizable=yes,scrollbars=yes";
var zoomUrl = "http://www.lanka.info/shops/booksStore/cdCommonQestions.htm";
newWin = window.open(zoomUrl,"Popup",windowParams);
}

function loadImage( image , winWidth, winHeight,back)
{                                           
if ( image.toUpperCase().indexOf("HTM") != -1 ) 
{
alert ("Sorry, the back cover details of this book is not available");
return;
}

if (newWin) 
{
if (newWin.closed == false) newWin.focus();
}
var windowParams = "width=" + winWidth + ",height=" + winHeight + ",resizable=no,scrollbars=yes" ;	
var zoomUrl = "http://www.lanka.info/shops/utils/bookZoomDisplay.jsp?imageLink="+image+"&back="+back;
newWin = window.open(zoomUrl,"winname",windowParams);
}

function schat()
{
var name = prompt("Please enter your name","");
if (name.length < 2) 
{
alert ("Please enter your full name");return;
}
var nl=name.indexOf(" ");if (nl>1) name = name.substr(0,nl);
var windowParams = "width=424,height=450,resizable=no,scrollbars=no,left=300,top=80";
var Url = "http://www.lanka.info/contactUs/schat/customer.jsp?login="+name;
newWin = window.open(Url,"blank",windowParams);
}


function renderMiddleBar()
{
document.write('<table class="kaprukaOnlineShopBody" style="border-bottom-width:0px;" cellpadding="0" cellspacing="0" border="0">');
document.write('<tr><td width="123" bgcolor="316CA6" height="16">&nbsp;</td><td width="*" bgcolor="FFFFFF" height="16"> ');
document.write('<table class=mediumb width="100%" cellpadding="0" cellspacing="0" border="0"><tr> ');
document.write('<td width="1%" bgcolor="316CA6" height="14" valign="top"> ');
document.write('<div align="right"><img src="http://www.lanka.info/images/TopCurve.gif" width="36" height="23"></div></td>');
document.write('<td width="*" height="14" align="center" bgcolor="99CCFF"><font class=tinyr>&nbsp</font></td>');
document.write('<td width="20%" bgcolor="#99CC99" height="14"><img src="http://www.lanka.info/images/TopRightG.gif" width="30" height="23" align="absmiddle">Sinhala&nbsp;Books</td>');
document.write('</tr></table></td></tr></table>');
}

function renderRates()
{
document.write('<table width="584" border="0" cellspacing=5 align="CENTER"><tr> ');
document.write('<td height="136" width="32%"> <table width="100" border="0" align="center" cellpadding="0" cellspacing="0"><tr> ');
document.write('<td><img src="http://www.lanka.info/images/ratesBar.gif" width="171" height="19"></td></tr></table>');
document.write('<table class=tinyr width="171" height="10" border="1" align="center" cellpadding="4" cellspacing="0" bordercolor="#006699"><tr> ');
document.write('<td height="123"><b>Average Shipping to USA/Canada.</b><br><br>10 books &nbsp;&nbsp;= US$15.00<br>5 books &nbsp;&nbsp; &nbsp;= US$8.50<br>1 book&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= US$3.30 <br>');
document.write('<br>These are estimates based on average book weights. You will be shown precise shipping charges to your country on the final payment page.</td></tr></table></td>');
document.write('<td height="136" width="68%" valign="middle"><table style="filter:SHADOW(color=gray, strength=3)" align="left" border="0" cellpadding="5" cellspacing="0"><tr><td align="CENTER"> ');
document.write('</td></tr></table><font class=tinyr><br><br><br><br>At Kapruka, you can shop with confidence. We use the latest encryption technology, digital certificates, secure commerce servers, and authentication to ensure that your personal information is secure online. We never store your credit card information. They are discarded after the transaction. You may goto <a class=ex href="http://www.lanka.info/contactUs/orderStatus.jsp">Order Status</a> page or call our office locations to inquire about your orders. U.S.A Central Office: +1-859-215-0159. Colombo Office: +1-94-12823336</font> </td></tr></table>');
}

function shoppingCartGuide()
{                                           
var windowParams = "width=620,height=640,resizable=yes,scrollbars=yes";
var zoomUrl = "http://www.lanka.info/help/shoppingCartGuide.html";
newWin = window.open(zoomUrl,"winname",windowParams);
}

function search()
{
window.focus();
if (document.form1.searchText.value.length < 1)
   {
   alert ("Please enter what you need to search");
   return false;
   }
window.location = "booksSelectPage.jsp?sc=0&co=search&searchText=" + document.form1.searchText.value;
return false;
}


