// JavaScript Document

function welcome()
{

alert("Hello friend.Welcome to Ketan's small World.Sit back and enjoy.");
}
function callalb(selectedit)
{
	alert(selectedit);
}


function knowhim()
{

alert("Hey its you!!!");
}

function showhidecontrol(obj)
{
	var myobj = document.getElementById(obj);
	if ( myobj.style.display != 'none' ) {
		myobj.style.display = 'none';
	}
	else {
		myobj.style.display = '';
	}

}
function validatewritetome()
{
    var strname = document.writetome.visitorname;
    var stremail = document.writetome.email;
    var strsubject = document.writetome.subject;
    var strmessage = document.writetome.message;

strname = strname.value;
strname = strname.replace(/^\s*|\s*$/g,"");
if (strname == "")
{
	    window.alert("Please enter your name.");
        return false;
}
   
   stremail = stremail.value;
stremail = stremail.replace(/^\s*|\s*$/g,"");
if (stremail == "")
{
	    window.alert("Please enter your e-mail address.");
        return false;
}
   
     if (stremail.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        return false;
    }
    if (stremail.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        return false;
    }
	
	strsubject = strsubject.value;
strsubject = strsubject.replace(/^\s*|\s*$/g,"");
if (strsubject == "")
{
	    window.alert("Please enter a subject.");
        return false;
}
	
	strmessage = strmessage.value;
strmessage = strmessage.replace(/^\s*|\s*$/g,"");
if (strmessage == "")
{
	    window.alert("Please enter a message.");
        return false;
}
    return true;
}


 



<!--

 
var message="Right click is disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false");

// --> 

//Gallery 

var albums = new Array("Pune Trip August 2009","GCOE friends in Bombay 2006-2007","Nashik 2009 Trip","Bangalore IT.IN 2007 and IT.BIZ 2008","Bangalore 2007-2009","Mangalore 2008","Hubli 2007-2009","Bombay Pix","Personal","GCOE Amravati");
var albumdescription = new Array("August 08 2009.Trip to Pune after a long gap of more than four years","GCOE friends in Bombay captured beautifully in the year 2006-2007.Some pictures from Infinity Mall,Andheri and some from Bandstand,Bandra","Trip to Nashik to visit the infant Jesus church","Participation in Bangalore IT.IN 2007 and IT.BIZ 2008.","IT Capital of India defined in my own way.Many good memories are bundled.","Couple of months stay in Mangalore was full of joy and work.","Pictures from the Hubli work place.","Pictures from Bombay.","Includes some of my old and new personal pictures.","Engineering days memories.");

var puneaug2k9=new Array("trip-started.jpg","bath-me.jpg","baths-workstation.jpg","pravin-sunil-vivek.jpg","ketan-sunil-vivek.jpg","group.jpg","trip-ended.jpg");
var puneaug2k9captions=new Array("Pravin,Ketan.Trip to Pune started at 700 hrs in the morning...","Vivek,Ketan.In Viveks home...Don't you think it is a Black and White Combination...Met Vivek after two years","Viveks workstation where he does all those interesting things with his Linux OS.","Pravin,Sunil,Vivek.In Pune Central.","Ketan,Sunil,Vivek.In Pune Central","Sitting Top:Pravin,Vivek,Anand Sitting Bottom:Mangesh,Ketan,Sunil","Trip to Pune ended by 1930hrs...Enjoyed a lot...Fully tired...");

var gcoepalsinbomb = new Array("yummyfood.jpg","pcketnit.jpg","groupsitting.jpg","groupring.jpg","groupstanding.jpg","sweetpune.jpg","mihirpravin.jpg","mihirketan.jpg","pravinketan.jpg","mihketpc.jpg","shooting.jpg","smoochontherocks.jpg");
var gcoepalsinbombcaptions = new Array("Mmmm..Yummy food.Pizza,lettuce salads and coke ready to get devoured.","Pravin,Ketan,Nitin.Ooops moved very close to the lens.","Preeti,Poonam,Ketan,Nitin,Pravin.Chatting and relaxing after enjoying some delicious food in Infinity Mall,Andheri","Five heads together for a ring and swing moment.","Nitin,Preeti,Poonam,Pravin,Ketan.Saying good bye to each other outside Infinity Mall,Andheri","Special sweets brought by Pravin from Pune.He would have been sent back if he would have forgotten the sweets.","Mihir,Pravin.Meeting each other after graduation.","Mihir,Ketan.Posing outside Taj Lands,Bandra after a royal lunch.","Pravin,Ketan.Smiles everywhere.Whose smile is better?I think Pravin's.Standing to cover the Worli Sea link behind us.Wondering when it will be completed.","Mihir,Ketan,Pravin.We thought of giving a 'Dil Chahta hai' pose later realized that simplicity would rule anytime.","A movie shooting near Bandstand.Some hot females giving us wonderful pose when we tried to capture them.","An intimate scene is captured by us 'Kitne badmash hain hum'. A couple is passionately kissing each other on the rocks.");

var nashik2k9pictures = new Array("inthetrain.jpg","igatpuristation.jpg","smartboys.jpg","insidejacket.jpg","inshadow.jpg","inoldgoggles.jpg","infantjesus.jpg","podium.jpg","tired1.jpg","tired2.jpg","afterwinning.jpg");
var nashik2k9captions = new Array("Trip to Nashik is already started and every one in the train started to enjoy.How come our people will stay away.","Picture perfect in the Igatpuri station.","Smart boys waiting for the train to move.","Hey from whom you are hiding and why???","After lunch we are cooling ourselves under the tree shadow.","Ladies in goggles from the 80's.","Infant Jesus statue inside the church.","This is not a bible book.It is a podium where the priest preached the whole day.","Tired from the journey.","Eagerly waiting when train will reach Dadar station.","Jubiliation after winning the housie game.Hurrah Hurrah!!!");


var bangpictures = new Array("vidhansoudha.jpg","vidhanandketan.jpg","plane.jpg","me.jpg","ganpathy.jpg","bulltemple.jpg","bigpeople.jpg","workinghard.jpg");
var bangcaptions = new Array("Vidhana Soudha,a place where all the big decisions of Karnataka takes place.","In front of Vidhana Soudha.","Flight to Bombay on 24th December 2008 captured.","Ketan in a simple mode.","Ganesh mandir in Vijayanagar.","Bull Temple in Basvangudi.","Soorya[Man with full energy],Ketan[???] and Harsha[Man with brains].Ketan working with big people.","Working hard to get a solution of compression technique.");


var bombpictures = new Array("mnfriends.jpg","donbosco.jpg","shalinibhavan.jpg","gatewayofindia.jpg","ketanandanand.jpg","leopold.jpg","hole.jpg","taj.jpg","me.jpg");var bombcaptions = new Array("Men at M and N research Lab.From left: Ketan,Kiran,Nilesh,Amit,Sudesh. Sitting Center:Mahesh.","Don Bosco in Matunga an old church.","Shalini Bhavan in Sion brings in front many emotional moments.","Gateway Of India,a place to visit when you are in Bombay.","Anand and Me standing to cover Gateway Of India behind us...Ha ha ha h...","Leopold cafe and bar.You will find majority of foreigners here.This is the place where the terrorist holed themselves in 26/11/2008 blood shed.","Mark of a gun shot fired by a terrorist in Leopold.","Taj standing tall after the 26/11/2008 terrorist attacks.","Near the Don Bosco church.");


var gcoepictures = new Array("collegefriendsparty.jpg","collegegroupphoto.jpg","gr8gang.jpg","hcrdevelopers.jpg","specialpeoplegcoeamt2005.jpg");
var gcoecaptions = new Array("A friends birthday party during college days.From left: Ketan,Poonam,Jaishree,Deepti,Dharti,Preeti,Pravin,Vijay,Anthony,Niraj.","EXTC 2005 Batch.Just before graduation.Guess where I am.","GR8 Gang a coolest group of GCOE 2005 batch.From left standing: Niraj,Vishal,Mayank,Vivek.From left Sitting: Vijay,Ketan,Pravin.","HCR-Handwritten Charater Recognition a project which revolutionized certain things back 2005.From left: Niraj,Anthony,Pravin,Ketan.","Some special people from GCOE Extc 2005 batch.From left standing: Anthony,Niraj,Pravin,Vineet.From left sitting: Amol,Ketan.");


var hublipictures = new Array("me.jpg","ketanandsantosh.jpg","ketanandshridhar.jpg","mahesh.jpg","mewithkid.jpg","incomp.jpg");
var hublicaptions = new Array("Sitting next to my love thinking what to do next.","Santosh's last day in GSPL.","Shridhar the man with immense energy.","Mahesh my cool friend.","Playing with a collegues kid.","In the middle of the development of the GCommunicator.");


var itpictures = new Array("bangmirror.jpg","standing.jpg","itbizteam.jpg","itbiztechnicians.jpg","itbizcoordinators.jpg");
var itcaptions = new Array("In Bangalore Mirror.It was one of the happiest moment when I knew we people appeared in the front page of Bangalore Mirror on 1 March 2008.From left: Mahesh,Soorya,Harsha,Santosh Kumar,Ketan.","IT.IN 2007 In bangalore.From left: Soorya,Harsha,Santosh Kumar,Ketan.","Standing proudly after successfully completing the demonstration of the Video conferencing in IT.BIZ 2008.From left: Ketan,Harsha,Soorya.","With the technicians in IT.BIZ 2008.From left: Ketan,Harsha,Techinican 1,Technician 2,Soorya.","With the BSNL Coordiators.From left: Ketan,Soorya,Harsha,Coordinator 1,Coordinator 2.");


var mangpictures = new Array("theater.jpg","temple.jpg","church.jpg","ketaninprank.jpg","don.jpg","finishing.jpg","ketanandgourish.jpg","ketanandram.jpg","inbeard.jpg");
var mangcaptions = new Array("In a theater in Mangalore with a cartoon statue of Imran Khan.","A small temple in Mangalore bus stand.","Church in mangalore which I never visited.Such a big sinner I am..ha ha ha hah.","Fed up of life.ha h aha h..ooops...","Don't disturb Don while at work.","Giving finishing touch to GEducation","Me and Gourish.","Me and Ram.","Can you recogize this old man!!!h ah ah ah ha.");


var perpictures = new Array("realpeople.jpg","meandsisinpeninsula.jpg","brosinpeninsula.jpg","mylove.jpg","pa.jpg","ketanlogo.jpg");
var percaptions = new Array("People without whom I am nothing.My favourite people.From left: Justin,Kavitha,Sailesh,Ketan.","What is there in the phone people???","Hey guys what is that rose for?Sitting straight for a perfect pose in their own style.","My first love.","Personal Assistant software developed by Ketan.A one stop solution for all your personal needs.To know more contact me.","Guess what it reveals.");



var intalbumvalue=0; //1,2,3,4,5,6...

var inttotalimages=0;
var intimageindex=0; //0 based index 

 function loaddefault()
 {
	 //document.gallery.mymenu.options.value ="0";
	 	 document.gallery.myimage.src = "images//" + "pleaseselect.jpg";
		 document.gallery.imageindex.value = "0 of 0";
		  document.gallery.imagecaption.value = "Please select an album!!!";
	 document.gallery.albumname.value="Please select an album!!!";
		document.gallery.albumdescription.value="Please select an album!!!";
 }
function scrollimage(intindex)
{
	//alert(imagecaptions.length);
	if (inttotalimages ==0)
	{
		alert("No images to scroll");
	}
	if (inttotalimages >0)
	{
		//alert("There are images to scroll");
		intimageindex = intimageindex + (intindex);

		if (albumvalue=="1")
		{
		  if (intimageindex < 0)
    	   intimageindex =  puneaug2k9.length - 1;
		   if (intimageindex == puneaug2k9.length)
    	  intimageindex = 0;
document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = puneaug2k9captions[intimageindex];
		  		  document.gallery.myimage.src = "images//puneaug2k9//" + puneaug2k9[intimageindex];
		}

				if (albumvalue=="2")
		{
		  if (intimageindex < 0)
    	   intimageindex = gcoepalsinbomb.length - 1;
		   if (intimageindex == gcoepalsinbomb.length)
    	  intimageindex = 0;
document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = gcoepalsinbombcaptions[intimageindex];
		  		  document.gallery.myimage.src = "images//gcoepalsinbomb//" + gcoepalsinbomb[intimageindex];
		}

				if (albumvalue=="3")
		{
		  if (intimageindex < 0)
    	   intimageindex = nashik2k9pictures.length - 1;
		   if (intimageindex == nashik2k9pictures.length)
    	  intimageindex = 0;
document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = nashik2k9captions[intimageindex];
		  		  document.gallery.myimage.src = "images//nashik2k9//" + nashik2k9pictures[intimageindex];
		}

		
		if (albumvalue == "4")
		{
				  if (intimageindex < 0)
    	   intimageindex = itpictures.length - 1;
		   if (intimageindex == itpictures.length)
    	  intimageindex = 0;
		  document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = itcaptions[intimageindex];
		  document.gallery.myimage.src = "images//it//" + itpictures[intimageindex];
		  //document.gallery.imageindex.value = (intimageindex + 1) + " of " +  imagecaptions.length;
//document.gallery.imagecaption.value = imagecaptions[intimageindex];
//document.gallery.myimage.src = "images\\" + images[intimageindex]; 


 		}
		if (albumvalue=="5")
		{
		  if (intimageindex < 0)
    	   intimageindex = bangpictures.length - 1;
		   if (intimageindex == bangpictures.length)
    	  intimageindex = 0;
document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = bangcaptions[intimageindex];
		  		  document.gallery.myimage.src = "images//bangalore//" + bangpictures[intimageindex];
		}
		if (albumvalue=="6")
		{
		  if (intimageindex < 0)
    	   intimageindex = mangpictures.length - 1;
		   if (intimageindex == mangpictures.length)
    	  intimageindex = 0;
document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = mangcaptions[intimageindex];
		  		  		  document.gallery.myimage.src = "images//mangalore//" + mangpictures[intimageindex];
		}
		if (albumvalue=="7")
		{
		 if (intimageindex < 0)
    	   intimageindex = hublipictures.length - 1;
		   if (intimageindex == hublipictures.length)
    	  intimageindex = 0;	
		  document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = hublicaptions[intimageindex];
		  		  		  document.gallery.myimage.src = "images//hubli//" + hublipictures[intimageindex];
		}
		if (albumvalue=="8")
		{
		 if (intimageindex < 0)
    	   intimageindex = bombpictures.length - 1;
		   if (intimageindex == bombpictures.length)
    	  intimageindex = 0;
		  document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = bombcaptions[intimageindex];
		  		  		  document.gallery.myimage.src = "images//bombay//" + bombpictures[intimageindex];
		}
		if (albumvalue=="9")
		{
		 if (intimageindex < 0)
    	   intimageindex = perpictures.length - 1;
		   if (intimageindex == perpictures.length)
    	  intimageindex = 0;
		  document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = percaptions[intimageindex];
		  		  		  document.gallery.myimage.src = "images//personal//" + perpictures[intimageindex];
		}
		if (albumvalue=="10")
		{
		 if (intimageindex < 0)
    	   intimageindex = gcoepictures.length - 1;
		   if (intimageindex == gcoepictures.length)
    	  intimageindex = 0;	
		  document.gallery.imageindex.value = (intimageindex + 1) + " of " +  inttotalimages;
		  document.gallery.imagecaption.value = gcoecaptions[intimageindex];
		  		  		  document.gallery.myimage.src = "images//gcoe//" + gcoepictures[intimageindex];
		}

		
		
	}
 
 

 
//document.gallery.imageindex.value = (intimageindex + 1) + " of " +  imagecaptions.length;
//document.gallery.imagecaption.value = imagecaptions[intimageindex];
//document.gallery.myimage.src = "images\\" + images[intimageindex]; 

 
}

 

function callalbum(p_selecteddata)
{
	
	var selecteddata = p_selecteddata.value;
	if (selecteddata == "0")
	{
		albumvalue=selecteddata;
		//alert(albumvalue);
		//
		//alert(albumvalue);	
		loaddefault();
	}
	else
	{
		  
		albumvalue = selecteddata;
		document.gallery.albumname.value=albums[selecteddata-1];
		document.gallery.albumdescription.value=albumdescription[selecteddata-1];
		
 
 			if (selecteddata == "1")
		{
		inttotalimages = puneaug2k9.length;	
		document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = puneaug2k9captions[0];
		  		  document.gallery.myimage.src = "images//puneaug2k9//" + puneaug2k9[0];
 		}
						if (selecteddata == "2")
		{
		inttotalimages = gcoepalsinbomb.length;	
		document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = gcoepalsinbombcaptions[0];
		  		  document.gallery.myimage.src = "images//gcoepalsinbomb//" + gcoepalsinbomb[0];
 		}

				if (selecteddata == "3")
		{
		inttotalimages = nashik2k9pictures.length;	
		document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = nashik2k9captions[0];
		  		  document.gallery.myimage.src = "images//nashik2k9//" + nashik2k9pictures[0];
 		}

		if (selecteddata == "4")
		{
		inttotalimages = itpictures.length;	
		document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = itcaptions[0];
		  		  document.gallery.myimage.src = "images//it//" + itpictures[0];
 		}
		if (selecteddata=="5")
		{
		inttotalimages = bangpictures.length;	
		document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = bangcaptions[0];
				  		  document.gallery.myimage.src = "images//bangalore//" + bangpictures[0];
		}
		if (selecteddata=="6")
		{
		inttotalimages = mangpictures.length;	
				document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = mangcaptions[0];
		  		  document.gallery.myimage.src = "images//mangalore//" + mangpictures[0];
		}
		if (selecteddata=="7")
		{
		inttotalimages = hublipictures.length;	
				document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = hublicaptions[0];
		  		  document.gallery.myimage.src = "images//hubli//" + hublipictures[0];
		}
		if (selecteddata=="8")
		{
		inttotalimages = bombpictures.length;	
				document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = bombcaptions[0];
		  		  document.gallery.myimage.src = "images//bombay//" + bombpictures[0];
		}
		if (selecteddata=="9")
		{
		inttotalimages = perpictures.length;	
				document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = percaptions[0];
		  		  document.gallery.myimage.src = "images//personal//" + perpictures[0];
		}
		if (selecteddata=="10")
		{
		inttotalimages = gcoepictures.length;
				document.gallery.imageindex.value = (1) + " of " +  inttotalimages;
		document.gallery.imagecaption.value = gcoecaptions[0];
		  		  document.gallery.myimage.src = "images//gcoe//" + gcoepictures[0];
		}

		intimageindex=0;
		//scrollimage(0);
		//load initial values 
		
	}
	
	//document.gallery.imageindex.value = inttotalimages;
	
}

//Gallery End 



var topic = new Array("Atlast started expressing","Video Conferencing at midnight","First repercussion from the inspiration[friend]  itself","Sulochana and Avdhesh - A short story ","Coffee Mug","Wow it is now w3c compliant...","A Legend named Feroze Khan","Blog Engine Initiated","Google is God!!!");
var bloglink = new Array("atlaststarted.php","vcatmidnight.php","firstrepercussion.php","sulochanaavdhesh.php","coffeemug.php","w3ccompliant.php","ferozekhan.php","b8.php","b9.php")

var blogstartsas = new Array("Blogging might be having many meanings many perceptions...","After a long day not so very long day at work...","Seriously my friend has given some generous and thought provoking...","A short girl of height 5'4'' in her mid 20's named Sulochana stayed in...","I am here to say something about me.Yes you guessed it right I am a coffee mug...","I did this on 21st April 2009 and 22nd April 2009","Feroze Khan a man who will be remembered for his charismatic...","I cannot exactly call it as a blog engine...","Can I say that??? A BIG question...");
var posteddate = new Array("31 March 2009 0251","31 March 2009 0833 ","03 April 2009 0127 ","04 April 2009 2137 ","14 April 2009 2231","24 April 2009 2209","28 April 2009 2313","12 May 2009 2032","15 May 2009 1432");


function callbloglinks()
{
	for (var i = 0 ; i < topic.length; i++)
	{
		//alert("Hello");
		 
		var x=document.getElementById('mytablee').insertRow(0);
var objtopic=x.insertCell(0);
var objblogstartsas=x.insertCell(1);
var objposteddate=x.insertCell(2);
objtopic.innerHTML="<td  width=25%><div align=left><a class=importantlinks href=" + bloglink[i] + ">" + topic[i] + "</a></div></td>";
objblogstartsas.innerHTML="<td  width=50%><div align=left>" + blogstartsas[i] + "</div></td>";
objposteddate.innerHTML = "<td  width=25%><div align=left>" + posteddate[i] + "</div></td>";
	}
	
	var x=document.getElementById('mytablee').insertRow(0);
var objtopic=x.insertCell(0);
var objblogstartsas=x.insertCell(1);
var objposteddate=x.insertCell(2);
objtopic.innerHTML="<td  width=25%><div align=center width=100% class=contenttabletrheader><strong class=contenttabletdheader>Topic</strong></div></td>";
//objtopic.innerHTML="<td width=25%><strong class=contenttabletdheader>Topic</strong></td>";
objblogstartsas.innerHTML="<td  width=50%><div align=center width=100% class=contenttabletrheader><strong class=contenttabletdheader>Blog starts as ...</strong></div></td>"; 
objposteddate.innerHTML = "<td  width=25%><div align=center width=100% class=contenttabletrheader><strong class=contenttabletdheader>Written on </strong></div></td>" ;
}


function resize(which, max) {
	
  var elem = document.getElementById(which);
  
  if (elem == undefined || elem == null) return false;
  if (max == undefined) max = 100;
  if (elem.width > elem.height) {
    if (elem.width > 187) elem.width = 100;
  } else {
    if (elem.height > 100) elem.height = 100;
  }
  alert("Done");
}




 
 var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

function writecomment(pageid) 
{
//	var pagename="test";
	var pageurl = "../comments/writecomment.php?pn="+ pageid;
	NewWindow(pageurl,null,550,375,'yes','center');
}



var xmlhttp
function showdata(pageid,visitorname,showmyname,email,message)
{
  
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support XMLHTTP!");
  return;
  }
var url="post-comment.php";
url=url+"?pageid="+pageid;
url=url+"&visitorname="+visitorname;
url=url+"&showmyname="+showmyname;
url=url+"&email="+email;
url=url+"&message="+message;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
 
}
 

function stateChanged()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
  }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}// JavaScript Document




function validatewritecomment()
{
    var strname = document.writecomment.visitorname;
    var stremail = document.writecomment.email;
 
    var strmessage = document.writecomment.message;

 
strname = strname.value;
strname = strname.replace(/^\s*|\s*$/g,"");
if (strname == "")
{
	    window.alert("Please enter your name.");
        return false;
}
   
   stremail = stremail.value;
stremail = stremail.replace(/^\s*|\s*$/g,"");
if (stremail == "")
{
	    window.alert("Please enter your e-mail address.");
        return false;
}
   
     if (stremail.indexOf("@", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        return false;
    }
    if (stremail.indexOf(".", 0) < 0)
    {
        window.alert("Please enter a valid e-mail address.");
        return false;
    }
	
 	
	strmessage = strmessage.value;
strmessage = strmessage.replace(/^\s*|\s*$/g,"");
if (strmessage == "")
{
	    window.alert("Please enter a message.");
        return false;
}
    return true;
}







//var crossobj=document.all? document.all.floatingdiv : document.getElementById("floatingdiv");
//var maintable = document.all? document.all.tblmain : document.getElementById("tblmain");
//var intstaticontentheight = crossobj.clientHeight;
//var approxpageheight = maintable.clientHeight ;
//
// 
// //define reference to the body object in IE
//var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body;
//
//function positionit()
//{
// 
//	var mypageheight = pageHeight();
//    var dsocleft=document.all? iebody.scrollLeft : pageXOffset;
//	var dsoctop=document.all? iebody.scrollTop : pageYOffset;
//	if (document.all||document.getElementById)
//	{
// 
//		crossobj.style.left="0px";
//		crossobj.style.top=dsoctop+mypageheight-intstaticontentheight+"px";
//		  if (dsoctop+mypageheight-intstaticontentheight > approxpageheight+intstaticontentheight)
//		  {
//			  crossobj.style.left="0px";
//			  crossobj.style.top=approxpageheight+intstaticontentheight+"px";
//		  }
// 
//	}
//
//}
//
//function pageHeight() 
//{
//	return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  	document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;
//}
//function pageWidth() 
//{
//	return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
//}
//
//setInterval("positionit()",100);
//
// 