// JScript source code
function Check()
{

if (document.getElementById("reviewtitle").value=="" )
{
alert('Please Enter the Review Title.');
document.getElementById("reviewtitle").focus();
return false;
}
else
{

len=document.reg.reviewtitle.value.length 
standerd="*|,\":<>[]{}`\';()@&$#%";
  for(i=0;i<len;i++)
   {
	if(standerd.indexOf(document.reg.reviewtitle.value.charAt(i))!=-1) 
	{
	document.reg.reviewtitle.focus()
	document.reg.reviewtitle.select()
	alert("\n Kindly do not Use Special Character such as *|,\":<>[]{}`\';()@&$#%");
	return false;
	break
	}
   }
}
if(document.getElementById("review123").value=="")
{
alert('Please Enter the Review.');
document.getElementById("review123").focus();
return false;
}
else
{

len=document.reg.review123.value.length 
standerd="*|,\":<>[]{}`\';()@&$#%";
  for(i=0;i<len;i++)
   {
	if(standerd.indexOf(document.reg.review123.value.charAt(i))!=-1) 
	{
	document.reg.review123.focus()
	document.reg.review123.select()
	alert("\n Kindly do not Use Special Character such as *|,\":<>[]{}`\';()@&$#%");
	return false;
	break
	}
   }
}

if(document.getElementById("custName").value=="")
{
alert('Please Enter your name.');
document.getElementById("custName").focus();
return false;
}
if(document.getElementById("emailid").value=="")
{
alert('Please Enter your email.');
document.getElementById("emailid").focus();
return false;
}

if (document.getElementById("emailid").value.length != 0 )
{
  var str=document.getElementById("emailid").value
  var emaillen=document.getElementById("emailid").length 
  var er=0
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  
   standerd="1234567890abcdefghijklmnopqrstuvwxyz_ABCDEFGHIJKLMNOPQRSTUVWXYZ.@-"
   for(i=0;i<emaillen;i++)
   {
	if(standerd.indexOf(document.getElementById("emailid").charAt(i))==-1) 
	{
	document.getElementById("emailid").focus()
	document.getElementById("emailid").select()
	alert("Please enter valid email address.");
	return false;
	
	}
  }
	
	if (!reg1.test(str) && reg2.test(str)) 
	{}	
	else
	{
	document.getElementById("emailid").select();
	alert("Please enter valid email address.");
	return false;
	}
}
 




alert('Thanks for entering Review');

}
function textCounter1(field, maxlimit) 
{
if (field.value.length > maxlimit) 
{
  alert('You cannot enter more than 100 Characters');
  field.value = field.value.substring(0, maxlimit);
 }
}
function textCounter(field, maxlimit) 
{
if (field.value.length > maxlimit) 
{
  alert('You cannot enter more than 5000 Characters');
  field.value = field.value.substring(0, maxlimit);
 }
}


function a(txt) {
		self.status = txt;
}

function b() {
		self.status = "";
}
var loadVp = true;
 
function load_viewport() {
  loadVp = false;
  var viewportDiv = document.getElementById("viewport");
  var viewer = new google.books.DefaultViewer(viewportDiv,
    {showLinkChrome: false});
  viewer.load(isbn, handle_not_found);
}
 
function handle_not_found() {
  //var viewportSection = document.getElementById("viewportSection");
  //viewportSection.style.display = 'none';
  //var element = document.getElementById("google_<%=ISBN%>");
  //element.style.display = 'none';
}
 
google.load("books", "0");
 
google.setOnLoadCallback(function() {
  var dummyVal = "Y";
});
 
function open_viewport() {
  var viewportSectionDiv = document.getElementById("viewportSection");
  viewportSectionDiv.style.display = '';
 
  var element = document.getElementById("google_"+isbn);
  element.style.display = 'none';
  if (loadVp) {
    load_viewport ();
  }
}
 
function close_viewport() {
  var viewportSectionDiv = document.getElementById("viewportSection");
  viewportSectionDiv.style.display = 'none';
 
  var element = document.getElementById("google_"+isbn);
  element.style.display = '';
}
 
// Function to process GBS info and update the DOM.
function ProcessGBSBookInfo(booksInfo) {
  for (isbn in booksInfo) {
    var element = document.getElementById("google_" + isbn);
    var bookInfo = booksInfo[isbn];
		if (bookInfo) {
			if ((bookInfo.preview == "full" || bookInfo.preview == "partial")
				&& (typeof(bookInfo.embeddable) == 'undefined' ||
						bookInfo.embeddable != false))
			{
				element.style.display = '';
			}
    }
  }
}
 function openNewPopup (url, width, height) {
  popupWin = window.open (url,
        'View',"width= " + width + ",height=" + height +
		",toolbar=0,scrollbars=0,resizable=0,menubar=0,bgcolor=#EEF7FF");
  if (window.focus) {
     popupWin.focus ();
  }
}                    
 
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
	if(document.layers)	   //NN4+
  {
  	document.layers[szDivID].visibility = iState ? "show" : "hide";
  }
  else if(document.getElementById)	  //gecko(NN6) + IE 5+
  {
  	var obj = document.getElementById(szDivID);
    obj.style.visibility = iState ? "visible" : "hidden";
  }
  else if(document.all)	// IE 4
  {
    document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
  }
}
function openpopWindow(url)
{
	
	window.open (url, 'newwindow', 'height=450,width=350, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, directories=no, status=no');
}

function OpenCOD()
{

var openWin = window.open('Cod.htm','Cod',resizable = 0,'width=600;height=400')
}