// JavaScript Document

var swlag=null;

var nelng=null;

var nelat=null;

var swlat=null;

var map=null;

var normalProj = null;

var s_title = 0;

var pagenum;

var rowperpage=10;

var totalrows=0;

var prev;

var next;

var lastpage;

var limit=0;

var strip="";

var ORDER = 'ASC';

var zoomlevel=6;

var side_bar_html="";

var geocoder = null;

var Move_span =null;

var x1 = 40.669181;

var x2 = 41.669181;

var y1 = -74.34448;

var y2 = -75.34448;



var sid1=null;

var pids=null;

var uids=null;

var TYPE_SER=false;

var temp_amout=1;

var temp_user_var=0;



var golobal_lat=40.669181;



var golobal_lng=-73.34448;

var ID = 1;

var xmlDoc_zoom = null;

/*var MODE= 0;

function change_mode()

{

	if(MODE==0)

	{

		document.getElementById("mode_txt").innerHTML = 'Exit';

		document.getElementById("header_panel").style.display='none';

		document.getElementById("left_panel").style.display='none';

		document.getElementById("right_panel").style.display='none';

		document.getElementById("footer_panel").style.display='none';

		document.getElementById("footer").style.display='none';

		document.getElementById("test_effect").style.display='none';

		document.getElementById("legent_panel").style.display='none';

		document.getElementById("photo_galley").style.display='none';

		document.getElementById("search_panel").style.display='none';

		document.getElementById("space_1").style.display='none';

		document.getElementById("space_2").style.display='none';

		var h = document.documentElement.clientHeight;

		h-=8;

		document.getElementById("legent_td").setAttribute( (document.all ? 'className' : 'class'),"");

		document.getElementById("map").style.height = h+'px';

		document.getElementById("body_table").style.width ='100%';

		document.getElementById("map").style.marginTop ='0px';



		

		

		MODE=1;

	}

	else

	{

		document.getElementById("mode_txt").innerHTML = 'Full Screen';

		document.getElementById("header_panel").style.display='block';

		document.getElementById("left_panel").style.display='block';

		document.getElementById("right_panel").style.display='block';

		document.getElementById("footer_panel").style.display='block';

		document.getElementById("footer").style.display='block';

		document.getElementById("test_effect").style.display='none';

		document.getElementById("legent_panel").style.display='block';

		document.getElementById("photo_galley").style.display='block';

		document.getElementById("search_panel").style.display='block';

		document.getElementById("map").style.height = '377px';

		document.getElementById("body_table").style.width ='95%';

		document.getElementById("space_1").style.display='block';

		document.getElementById("space_2").style.display='block';

		document.getElementById("map").style.marginTop ='3px';

		document.getElementById("legent_td").setAttribute( (document.all ? 'className' : 'class'),"barBg");

		

		MODE=0;

	}

}*/

function GetXmlHttpObject()

{ 

	var objXMLHttp=null;

	if (window.XMLHttpRequest)

	{

		objXMLHttp=new XMLHttpRequest()

	}

	else if (window.ActiveXObject)

	{

		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")

	}

	return objXMLHttp;

}



function load_map()

{

	if (GBrowserIsCompatible())

	{

		map= new GMap2(document.getElementById("map"));

		map.addControl(new GMapTypeControl());

		//add terrain

		map.addMapType(G_PHYSICAL_MAP);

		//set terrain default

		map.setMapType(G_PHYSICAL_MAP);

		map.addControl(new GOverviewMapControl(new GSize(128,96)));

		map.setCenter(new GLatLng(golobal_lat,golobal_lng),6);

		

		geocoder = new GClientGeocoder();

		//add mouse wheel scoll for zoom

		map.enableScrollWheelZoom();

        map.addControl(new DragZoomControl());

		GEvent.addListener(map, 'mousemove', mouseMove);

		//mouse position

		normalProj = G_NORMAL_MAP.getProjection();

	

		document.getElementById('geoser').value="";

		document.getElementById('sertitle').value="";

		document.getElementById("zoomright").style.display="block";

		document.getElementById("zoomm").style.display="block";

		document.getElementById("zoomtop").style.display="block";

		document.getElementById("zoomdown").style.display="block";

		document.getElementById("zoomleft").style.display="block";

		document.getElementById("zoomp").style.display="block";

		/*document.getElementById("gps").style.display="block";

		document.getElementById("fullscreen").style.display="block";

				*/

		map.getContainer().appendChild(document.getElementById("zoomp"));

		

		var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(18,66));

		pos.apply(document.getElementById("zoomp"));

		map.getContainer().appendChild(document.getElementById("zoomp"));

		var pos1 = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(18,84));

		pos1.apply(document.getElementById("zoomm"));

		map.getContainer().appendChild(document.getElementById("zoomm"));

		var pos2 = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(18,9));

		pos2.apply(document.getElementById("zoomtop"));

		map.getContainer().appendChild(document.getElementById("zoomtop"));

		var pos3 = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(18,45));

		pos3.apply(document.getElementById("zoomdown"));

		map.getContainer().appendChild(document.getElementById("zoomdown"));

	  	var pos4 = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(9,27));

		pos4.apply(document.getElementById("zoomleft"));

		map.getContainer().appendChild(document.getElementById("zoomleft"));

		var pos5 = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(27,27));

		pos5.apply(document.getElementById("zoomright"));

		map.getContainer().appendChild(document.getElementById("zoomright"));  

		/*var pos6 = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(9,27));

     	 pos6.apply(document.getElementById("gps"));

     	 map.getContainer().appendChild(document.getElementById("gps"));

		

		

		var pos7 = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(2,142));

		pos7.apply(document.getElementById("fullscreen"));

		 map.getContainer().appendChild(document.getElementById("fullscreen"));*/

		

	  }



}

function mouseMove(mousePt) {

	mouseLatLng = mousePt;

	var zoom = map.getZoom();

	var mousePx = normalProj.fromLatLngToPixel(mousePt, zoom);

	

	var oStatusDiv = document.getElementById("gps")	

	if (oStatusDiv) {

		oStatusDiv.innerHTML = 'GPS: '+ mousePt.y.toFixed(6) + ', ' + mousePt.x.toFixed(6);

		oStatusDiv.innerHTML += '<br> ';

		//oStatusDiv.innerHTML += 'Mouse Px: ' + mousePx.x + ', ' + mousePx.y;

		//oStatusDiv.innerHTML += '<br>';

		//oStatusDiv.innerHTML += 'Tile: ' + Math.floor(mousePx.x / 256) + ', ' + Math.floor(mousePx.y / 256);

	}

}



function callmoveup()

{

	map.panDirection(0,1);

	//document.getElementById("grayPopup").style.display = 'block';

//	document.getElementById("divwaiting").style.display = 'block';

}



// function to move map in downward direction

function callmovedown()

{

	map.panDirection(0,-1);

	//document.getElementById("grayPopup").style.display = 'block';

//	document.getElementById("divwaiting").style.display = 'block';

}

// function to move map in left direction

function callmoveleft()

{

	map.panDirection(1,0);

	//document.getElementById("grayPopup").style.display = 'block';

//	document.getElementById("divwaiting").style.display = 'block';

}

// function to move map in right direction

function callmoveright()

{

	map.panDirection(-1,0);

	//document.getElementById("grayPopup").style.display = 'block';

//	document.getElementById("divwaiting").style.displa//setTimeout("event_search()",500);

}



function zoomin()

{

	map.zoomIn();

	//document.getElementById("grayPopup").style.display = 'block';

//	document.getElementById("divwaiting").style.display = 'block';

}



function zoomout()

{

	map.zoomOut();

	//document.getElementById("grayPopup").style.display = 'block';

//	document.getElementById("divwaiting").style.display = 'block';

}





var ipval=null;

function default_search_rec(ipval)           // function use for show exist task after the document refresh.

{

	var url="ip_search.php";

	url=url+"?ip="+ipval;

	url=url+"&c="+Math.random();

	//alert(url);

	search_rec_ajax_ip(url); 

}

	

	

function search_rec_ajax_ip(url)

{

	zxmlHttpCommonIP = GetXmlHttpObject();

	if (zxmlHttpCommonIP==null)

	{

		alert ("Browser does not support HTTP Request")

		return

	} 

	zxmlHttpCommonIP.onreadystatechange=stateChangedip ;

	zxmlHttpCommonIP.open("GET",url,true);

	zxmlHttpCommonIP.send(null);

}

	

	

function stateChangedip() 

{

	if (zxmlHttpCommonIP.readyState==4 || zxmlHttpCommonIP.readyState=="complete")

	{

		document.getElementById("grayPopup").style.display = 'none';

		document.getElementById("divwaiting").style.display = 'none';

		var data = zxmlHttpCommonIP.responseText;

		var temp_new=data.split('#');

		golobal_lat=temp_new[0];

		golobal_lng=temp_new[1];

		set_map_marker();

	}

	if(zxmlHttpCommonIP.readyState==0 || zxmlHttpCommonIP.readyState==1 || zxmlHttpCommonIP.readyState==2 || zxmlHttpCommonIP.readyState==3 )

	{

		document.getElementById("grayPopup").style.display = 'block';

		document.getElementById("divwaiting").style.display = 'block';

	}

}

	

	

function set_map_marker()

{

	map.setCenter(new GLatLng(golobal_lat,golobal_lng),6);

	Move_span = GEvent.addListener(map, "moveend", function(){

												move_pan();

												});

	event_search();

		

}



function event_search()

{

	var bounds = map.getBounds();

	var southWest = bounds.getSouthWest();

	var northEast = bounds.getNorthEast();				

	 swlag=southWest.lng();

	 nelng=northEast.lng();

	 nest=northEast.lat();

	 swlat=southWest.lat();

	 x1=southWest.lat();

	 y1=northEast.lng();

	 x2=northEast.lat();

	 y2=southWest.lng();

	 zoomlevel=map.getZoom();

		

		if(zoomlevel>3)

		{

			

			zoom();

		}

		else

		{

			 zoomlevel=4;

			  map.setZoom(4);

	

			//document.getElementById("grayPopup").style.display = 'none';

			//document.getElementById("divwaiting").style.display = 'none';

		}





}





function zoom()

{

	var url= "rq="+2;

	url=url+"&q1="+x1;

	url=url+"&q2="+y1;

	url=url+"&q3="+x2;

	url=url+"&q4="+y2;

	url=url+"&c="+Math.random();

	search_rec_ajax_zoom(url); 

}

	

var zxmlHttp_zoom = null;

function search_rec_ajax_zoom(url)

{

	

	zxmlHttp_zoom = GetXmlHttpObject();

	if (zxmlHttp_zoom==null)

	{

		alert ("Browser does not support HTTP Request")

		return;

	} 

//psot method

var file_name = 'test.php';

zxmlHttp_zoom.open("POST", file_name, true);

	zxmlHttp_zoom.onreadystatechange = stateChangedh_zoom; 

	zxmlHttp_zoom.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

	zxmlHttp_zoom.setRequestHeader("Content-length", url.length);

	zxmlHttp_zoom.setRequestHeader("Connection", "close");

	zxmlHttp_zoom.send(url);



}

	

function stateChangedh_zoom() 

{ 

	if (zxmlHttp_zoom.readyState==4 || zxmlHttp_zoom.readyState=="complete")

	{ 					

		document.getElementById("grayPopup").style.display = 'none';

		document.getElementById("divwaiting").style.display = 'none';

		xmlDoc_zoom = zxmlHttp_zoom.responseXML;

		show_on_map();

		showadd();	

	} 

	if (zxmlHttp_zoom.readyState==0 ||zxmlHttp_zoom.readyState==2 || zxmlHttp_zoom.readyState==1 || zxmlHttp_zoom.readyState==3 )

	{

		document.getElementById("grayPopup").style.display = 'block';

		document.getElementById("divwaiting").style.display = 'block';

	}

} 



function show_on_map()

{

	map.clearOverlays();

	var data1 = xmlDoc_zoom.getElementsByTagName("data"+ID);

	var mid = xmlDoc_zoom.getElementsByTagName("mid"+ID);

	var curid = xmlDoc_zoom.getElementsByTagName("curid"+ID);

	var title = xmlDoc_zoom.getElementsByTagName("title"+ID);

	var desc = xmlDoc_zoom.getElementsByTagName("desc"+ID);

	var img = xmlDoc_zoom.getElementsByTagName("img"+ID);

	var lat = xmlDoc_zoom.getElementsByTagName("lat"+ID);

	var lng = xmlDoc_zoom.getElementsByTagName("lng"+ID);

	var no = xmlDoc_zoom.getElementsByTagName("no"+ID);

	var rat = xmlDoc_zoom.getElementsByTagName("rat"+ID);

    var reclength=data1.length;	

				

										

	if(TYPE_SER)

		var bounds = new GLatLngBounds();



	if(data1.length==0)

	{

	//	document.getElementById('popdivindex').innerHTML='No records found.';

		document.getElementById('rec_not').innerHTML='No records found.';

		document.getElementById("show3").innerHTML=""; 

		document.getElementById("show4").innerHTML="";

		document.getElementById("t_count").innerHTML = '&nbsp;0';

		document.getElementById("tab").innerHTML = '<div class="for_paging_div" style=" margin-top:2em; color:#990000; font-size:12px;">  There is no fishing spots available in this area, please refine your search criteria!</div>';

		document.getElementById("tab_strip").innerHTML = '';

	}

	else

	{

		document.getElementById('rec_not').innerHTML='&nbsp;';

		var total_count = xmlDoc_zoom.getElementsByTagName("totalcount")[0].firstChild.nodeValue;

		document.getElementById("t_count").innerHTML = '&nbsp;'+total_count;

		for (var i = 0; i <data1.length; i++) 

		{

			mid1=String(mid[i].firstChild.nodeValue);

			curid1=String(curid[i].firstChild.nodeValue);

			title1=String(title[i].firstChild.nodeValue);

			desc1= String(desc[i].firstChild.nodeValue); 

			img1= String(img[i].firstChild.nodeValue); 

			lat1= String(lat[i].firstChild.nodeValue); 

	

												lng1= String(lng[i].firstChild.nodeValue); 

	

												no1= String(no[i].firstChild.nodeValue); 

	

												rat1= String(rat[i].firstChild.nodeValue); 

	

											

	

												if(curid1 ==2 ) // inveted marker

													var msg ="Invited Fishing Report"

	

												if(curid1==1) // User marker

													var msg ="Your Shared Fishing Report"

	

												if(curid1==3)

													var msg ="Secret Fishing Report"

	

												if(curid1==0)

													var msg ="Shared Fishing Report"

	

												if(curid1==5)

													var msg ="Regional Fishing Report"

													

										

												var point = new GLatLng(lat1,lng1);

												

												if(TYPE_SER)

													bounds.extend(point);

												

												var info=fun(title1,no1,rat1,img1,mid1);	  	

	

																

												v=createInfoMarker(point,info,i,curid1);

	

												map.addOverlay(v);

										

										

										} 







				 }

					

					

					if(TYPE_SER)

					{

						

						var map_zoom = map.getBoundsZoomLevel(bounds);

						map.setZoom(map.getBoundsZoomLevel(bounds));

						var clat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) /2;

						var clng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) /2;

						map_zoom--;

						map.setCenter(new GLatLng(clat,clng),map_zoom );

						if(map_zoom<3)

							zoomlevel = 4;

						else

							zoomlevel=map_zoom;

						

					}

					

					pagenum = 1;

					show_grid();

	

				

}



function fun(title1,no1,rat1,img1,mid1)

{

	table ='<div style="height:100%; width:300px;" id="taran1"><table width="100%"  border="0" cellspacing="0" cellpadding="5"><tr><td width="80" rowspan="2" valign="middle" class="dsc"><div class="mainjsimg"><a href="detail1.php?pid='+mid1+'"><img src=uploadimg/thumbnail/'+img1+' alt="click the image" width="75" height="75" hspace="5" vspace="5" border="none"></a></div></td><td colspan="2" valign="top" class="tit"><b>'+ title1 +'</b><br /><br /><br /><b>Number Of Comments&nbsp;&nbsp;'+no1+'</b></td></tr><tr><td width="49" valign="middle" class="tit"><b>Rating&nbsp;</b></td><td width="182" valign="top" class="tit"><b><iframe frameborder="0" scrolling="no" width="150px;" height="20px" class="ifrmrat" src="rat.php?pid='+mid1+'&rat='+rat1+'"></iframe></b></td></tr><tr><td colspan="3" align="center" a><a href="detail1.php?pid='+mid1+'" class="descs1">Read the full report!</a></td></tr></table></div>';

table += '<div id="taran2" style="display:none";></div>';

return table;

}	





 function createInfoMarker(point,info,i,curid) 

{

	

	   	invitedIcon = createIcon("images/marker_red.gif");  	  //yello color

		userIconPublic = createIcon("images/marker_def.gif");    // blue color

		userIconPrivate=createIcon("images/marker_org.gif");      //ornage color

		usedefault=createIcon("images/marker_blue.gif");  

		userIconPublicReginal = createIcon("images/marker_brown.gif");    // blue color

		if(curid ==2 ) // inveted marker

  	    	var marker = new GMarker(point, invitedIcon);

		if(curid==1) // User marker

			var marker = new GMarker(point, userIconPublic);

		if(curid==3)

			var marker = new GMarker(point, userIconPrivate);

		if(curid==0)

			var marker = new GMarker(point, usedefault);

		if(curid==5)

			var marker = new GMarker(point, userIconPublicReginal);

      		GEvent.addListener(marker, "click", function() 

			{

				marker.openInfoWindowHtml(info);								 



          	});





		return marker;



	}



	

function show_grid()

{

	//left colum add from admin

	leftimg(rowperpage);

	// right column add from admin

	rightimg(rowperpage);

	side_bar_html ="";

	var data1 = xmlDoc_zoom.getElementsByTagName("data"+ID);

	var mid = xmlDoc_zoom.getElementsByTagName("mid"+ID);

	var curid = xmlDoc_zoom.getElementsByTagName("curid"+ID);

	var title = xmlDoc_zoom.getElementsByTagName("title"+ID);

	var desc = xmlDoc_zoom.getElementsByTagName("desc"+ID);

	var img = xmlDoc_zoom.getElementsByTagName("img"+ID);

	var lat = xmlDoc_zoom.getElementsByTagName("lat"+ID);

	var lng = xmlDoc_zoom.getElementsByTagName("lng"+ID);

	var no = xmlDoc_zoom.getElementsByTagName("no"+ID);

	var rat = xmlDoc_zoom.getElementsByTagName("rat"+ID);

    var reclength=data1.length;			

	if(data1.length==0)

	{

		setTimeout("funhide_record();",5000);

		document.getElementById("tab").innerHTML="";

		document.getElementById("show3").innerHTML=""; 

		document.getElementById("show4").innerHTML="";

		document.getElementById("t_count").innerHTML = '&nbsp;0';

		document.getElementById("tab").innerHTML = '<div class="for_paging_div" style=" margin-top:2em; color:#990000; font-size:12px;"> There is no fishing spots available in this area, please refine your search criteria!</div>';

		document.getElementById("tab_strip").innerHTML = '';

	}

	else

	{

								side_bar_html="";

								strip="";



								side_bar_html += "<div><table cellspacing='0' cellpadding='0' border='0'  width='100%'><tr><td>";



	  								//for (var i = 0; i < data1.length; i++)

									if(ORDER=='ASC')

									{

										limit=((pagenum-1)*rowperpage);

										//alert(limit);

										lastpage=Math.ceil(reclength/rowperpage);

										strip="";

										var page_select = pagenum;

										var next=pagenum+1;

										if(pagenum<1)

										{

											pagenum =1;

											next=2;

										}

										else if(pagenum>lastpage || pagenum==lastpage)

										{

											lastpage=pagenum;

											next=pagenum+1;

										}

										

										max_record = limit+rowperpage;

									

										if(max_record>reclength)

											max_record = reclength;

										var strip_size = 5;

										var pageno =1;// (pagenum - Math.ceil(strip_size/2)+1);

	

	

									for(counter=limit;counter<max_record;counter++)	

										{



											mid1=String(mid[counter].firstChild.nodeValue);



											curid1=String(curid[counter].firstChild.nodeValue);



											title1=String(title[counter].firstChild.nodeValue);



											desc1= String(desc[counter].firstChild.nodeValue); 



											img1= String(img[counter].firstChild.nodeValue); 



											lat1= String(lat[counter].firstChild.nodeValue); 



											lng1= String(lng[counter].firstChild.nodeValue); 



											no1= String(no[counter].firstChild.nodeValue); 



											rat1= String(rat[counter].firstChild.nodeValue); 



									

											if(curid1 ==2 ) // inveted marker



												var msg ="Invited Fishing Report"



											if(curid1==1) // User marker



												var msg ="Your Shared Fishing Report"



											if(curid1==3)



												var msg ="Secret Fishing Report"



											if(curid1==0)



												var msg ="Shared Fishing Report"



											if(curid1==5)



												var msg ="Regional Fishing Report"



									side_bar_html +='<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td class="greentable" height="111"><div align="center" class="fishingSpotImgae"><a href="detail1.php?pid='+mid1+'"><img src="uploadimg/thumbnail/'+img1+'" width="98" height="81" border="none"></a></div><div style="overflow:auto; padding-top:5px;"><div class="more"><a href="detail1.php?pid='+mid1+'"><img src="images/btn_readmore.gif" border="none" /></a></div><div class="title_more" >'+ title1 +'</div><div><div class="inner_text" >'+desc1+'</div><div class="inner_text_type">Fishing Report Category : '+ msg +'</div></div></div></td></tr></table>'

									

										} 



										side_bar_html += '</td></tr></table></div>'; 



										

									strip=""

									strip ='<div class="for_paging_div">&nbsp;&nbsp;'; 

									strip+='<div class="paging_index"><ul>';

									lastpage++;

								

									for(var i=0;i<strip_size;i++)

									{

										if(pageno>0 && pageno<lastpage)

										{

											var p = (pageno-1)*rowperpage;

												var p1 = p+rowperpage;

												if(p1>reclength)

													p1=reclength;

												p++;

											if(pageno==page_select)

											{

												

												strip+='<li class="current">'+p+'-'+p1+'</li>';

											}

											else

											{

												strip+='<li><a onclick="pagination('+pageno+')">'+p+'-'+p1+'</a></li>';

											}

										}

										pageno++;

									}

									//if(next<lastpage)

										//strip+=	'<li><a onclick="pagination('+next+')">Next</a></li>';

									//	var final_view = view;

									strip+='</ul></div></div><div style="clear:both;"></div>';

									

									if(side_bar_html!="")

									{

										document.getElementById("tab").innerHTML = side_bar_html;

										document.getElementById("tab_strip").innerHTML = strip;

									}

									else

									{

										document.getElementById("tab").innerHTML = '<div class="for_paging_div" style=" margin-top:2em; color:#990000; font-size:12px;">  There is no fishing spots available in this area, please refine your search criteria!</div>';//side_bar_html+strip; 	

										document.getElementById("tab_strip").innerHTML = ''

									}

								}

								else

								{

									

									

									limit=(reclength-((pagenum-1)*rowperpage))-1;

										

										lastpage=Math.ceil(reclength/rowperpage);

									

										var page_select = pagenum;

										var next=pagenum+1;

										if(pagenum<1)

										{

											pagenum =1;

											next=2;

										}

										else if(pagenum>lastpage || pagenum==lastpage)

										{

											lastpage=pagenum;

											next=pagenum+1;

										}

										

										max_record = limit-rowperpage;

									//alert("max"+max_record);

										if(max_record<0)

											max_record = 0;

										var strip_size = 5;

										var pageno = 1;//(pagenum - Math.ceil(strip_size/2)+1);

									for(counter=limit;counter>=max_record;counter--)	

										{



											mid1=String(mid[counter].firstChild.nodeValue);



											curid1=String(curid[counter].firstChild.nodeValue);



											title1=String(title[counter].firstChild.nodeValue);



											desc1= String(desc[counter].firstChild.nodeValue); 



											img1= String(img[counter].firstChild.nodeValue); 



											lat1= String(lat[counter].firstChild.nodeValue); 



											lng1= String(lng[counter].firstChild.nodeValue); 



											no1= String(no[counter].firstChild.nodeValue); 



											rat1= String(rat[counter].firstChild.nodeValue); 



										

											if(curid1 ==2 ) // inveted marker



												var msg ="Invited Fishing Report"



											if(curid1==1) // User marker



												var msg ="Your Shared Fishing Report"



											if(curid1==3)



												var msg ="Secret Fishing Report"



											if(curid1==0)



												var msg ="Shared Fishing Report"



											if(curid1==5)



												var msg ="Regional Fishing Report"



									side_bar_html +='<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td class="greentable" height="111"><div align="center" class="fishingSpotImgae"><a href="detail1.php?pid='+mid1+'"><img src="uploadimg/thumbnail/'+img1+'" width="98" height="81" border="none"></a></div><div style="overflow:auto; padding-top:5px;"><div class="more"><a href="detail1.php?pid='+mid1+'"><img src="images/btn_readmore.gif" border="none" /></a></div><div class="title_more" >'+ title1 +'</div><div><div class="inner_text" >'+desc1+'</div><div class="inner_text_type">Fishing Report Category : '+ msg +'</div></div></div></td></tr></table>'

									

										} 



										side_bar_html += '</td></tr></table></div>'; 



										//if(TYPE_SER)

//

//										{

//

//										map.setZoom(map.getBoundsZoomLevel(bounds));

//

//										var clat = (bounds.getNorthEast().lat() + bounds.getSouthWest().lat()) /2;

//

//										var clng = (bounds.getNorthEast().lng() + bounds.getSouthWest().lng()) /2;

//

//										map.setCenter(new GLatLng(clat,clng));

//

//										TYPE_SER=false;

//

//										}

									

									strip ='<div class="for_paging_div">&nbsp;&nbsp;'; 

									strip+='<div class="paging_index"><ul>';

									lastpage++;

									for(var i=0;i<strip_size;i++)

									{

										if(pageno>0 && pageno<lastpage)

										{

											var p = (pageno-1)*rowperpage;

												var p1 = p+rowperpage;

												if(p1>reclength)

													p1=reclength;

												p++;

											if(pageno==page_select)

											{

												

												strip+='<li class="current">'+p+'-'+p1+'</li>';

											}

											else

											{

												strip+='<li><a onclick="pagination('+pageno+')">'+p+'-'+p1+'</a></li>';

											}

										}

										pageno++;

									}

									//if(next<lastpage)

										//strip+=	'<li><a onclick="pagination('+next+')">Next</a></li>';

									//	var final_view = view;

									strip+='</ul></div></div><div style="clear:both;"></div>';

									

									if(side_bar_html!="")

									{

										document.getElementById("tab").innerHTML = side_bar_html;

										document.getElementById("tab_strip").innerHTML = strip;

										

									}

									else

									{

										document.getElementById("tab").innerHTML = '<div class="for_paging_div" style=" margin-top:2em; color:#990000; font-size:12px;">  There is no fishing spots available in this area, please refine your search criteria!</div>';//side_bar_html+strip; 	

										document.getElementById("tab_strip").innerHTML = ''

									}	





								}



			}

			if(TYPE_SER)

			{

						TYPE_SER=false;

						Move_span = GEvent.addListener(map, "moveend", function(){

												move_pan();

												});

						//alert(Move_span);

						

			}

}





	

function funhide_record()

			{

				//document.getElementById('popdivindex').innerHTML="";

				document.getElementById('rec_not').innerHTML="";

			}

			

//////////////////function ofmap icon//////////////					

function createIcon(src)

{

	var icon = new GIcon();

	icon.image = src;

	icon.shadow=null;

	icon.iconSize = new GSize(60, 46);

	//icon.shadowSize = new GSize(10, 10);

	icon.iconAnchor = new GPoint(6, 20);

	icon.infoWindowAnchor = new GPoint(10,15);

	return icon;

}



function showadd()

{

	var url="addshow.php";

	url=url+"?rq="+1;

	url=url+"&q1="+x1;

	url=url+"&q2="+y1;

	url=url+"&q3="+x2;

	url=url+"&q4="+y2;

	url=url+"&q5="+zoomlevel;

	url=url+"&c="+Math.random();

	showaddrec(url); 

}



var zxmlHttp22=null;

function showaddrec(url)

{

	zxmlHttp22 = GetXmlHttpObject();

	if (zxmlHttp22==null)

	{

		alert ("Browser does not support HTTP Request")

		return

	} 

	zxmlHttp22.onreadystatechange=stateChangedadd;

	zxmlHttp22.open("GET",url,true);

	zxmlHttp22.send(null);

}



function stateChangedadd() 

{

	if (zxmlHttp22.readyState==4 || zxmlHttp22.readyState=="complete")

	{

		document.getElementById("grayPopup").style.display = 'none';

		document.getElementById("divwaiting").style.display = 'none';

		var xmlDocadd = zxmlHttp22.responseXML;

		var dataadd = xmlDocadd.getElementsByTagName("dataadd");

		var midadd = xmlDocadd.getElementsByTagName("mid1");

		var imgadd = xmlDocadd.getElementsByTagName("img1");

		var latadd = xmlDocadd.getElementsByTagName("lat1");

		var lngadd = xmlDocadd.getElementsByTagName("lng1");

		var show = xmlDocadd.getElementsByTagName("show");

		var url = xmlDocadd.getElementsByTagName("url");

		if(dataadd.length==0)

		{

			document.getElementById('show1').style.display="block";

			document.getElementById('show2').style.display="block";

			document.getElementById('show1').innerHTML='';

			document.getElementById('show2').innerHTML='';

		}

		else

		{

			for (var i = 0; i < dataadd.length; i++) 

			{

				var show1=String(show[i].firstChild.nodeValue);

				if(i==0)

				{

					var img1= String(imgadd[0].firstChild.nodeValue); 

					var url1= String(url[0].firstChild.nodeValue); 

					if(url1==0)

					{

						if(show1=="top")

						{

							document.getElementById('show1').style.display="block";

							document.getElementById('show1').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";

						}

						if(show1=="bot")

						{

							document.getElementById('show2').style.display="block";

							document.getElementById('show2').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";

						}

					}

					else

					{

						if(show1=="top")

						{

							document.getElementById('show1').style.display="block";

							document.getElementById('show1').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"'   style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



						}

						if(show1=="bot")

						{

							document.getElementById('show2').style.display="block";

							document.getElementById('show2').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"'  style=\"cursor:pointer\" border=\"none\"  height='115'></a>";

						}



					}

			}



			if(i==1)

			{

				 var img1= String(imgadd[1].firstChild.nodeValue); 

				 var url1= String(url[1].firstChild.nodeValue); 

				if(url1==0)

				{

					if(show1=="top")

					{

						document.getElementById('show1').style.display="none";

						document.getElementById('show1').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";

					}

					if(show1=="bot")

					{

						document.getElementById('show2').style.display="none";

						document.getElementById('show2').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";

					}

				}

				else

				{

					if(show1=="top")

					{

						document.getElementById('show1').style.display="block";

						document.getElementById('show1').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"' style=\"cursor:pointer\" border=\"none\"  height='115'></a>";

					}

					if(show1=="bot")

					{

						document.getElementById('show2').style.display="block";

						document.getElementById('show2').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"'  style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



					}



			}



	}

	if(i==2)

	{

		  var img1= String(imgadd[2].firstChild.nodeValue); 

		 var url1= String(url[2].firstChild.nodeValue); 

		if(url1==0)

		{

			if(show1=="top")

			{

				document.getElementById('show1').style.display="block";

				document.getElementById('show1').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";



			}

			if(show1=="bot")

			{

				document.getElementById('show2').style.display="block";

				document.getElementById('show2').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";



			}

		}

		else

		{

			if(show1=="top")

			{

				document.getElementById('show1').style.display="block";

				document.getElementById('show1').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"'  style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



			}



			if(show1=="bot")

			{

					document.getElementById('show2').style.display="block";

					document.getElementById('show2').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"' style=\"cursor:pointer\" border=\"none\"  height='115'></a>";

		

			}

		}

	}

	if(i==3)

	{



													 var img1= String(imgadd[3].firstChild.nodeValue); 



															 var url1= String(url[3].firstChild.nodeValue); 



															//alert(img1);



															if(url1==0)



															{



															



																if(show1=="top")



																{

																document.getElementById('show1').style.display="block";

																document.getElementById('show1').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";



																}



																if(show1=="bot")



																{

																document.getElementById('show2').style.display="block";

																document.getElementById('show2').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";



																}



															}



															else



															{



																if(show1=="top")



																	{

																	document.getElementById('show1').style.display="block";

																	document.getElementById('show1').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"' style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



																	}



																	if(show1=="bot")



																	{

																	document.getElementById('show2').style.display="block";

																	document.getElementById('show2').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"' style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



																	}



															}



											}



											



											if(i==4)



											{



													  var img1= String(imgadd[4].firstChild.nodeValue); 



															 var url1= String(url[4].firstChild.nodeValue); 



															//alert(img1);



															if(url1==0)



															{



															



																if(show1=="top")



																{

																document.getElementById('show1').style.display="block";

																document.getElementById('show1').innerHTML="<img src='admin/add_img_upload/main/"+img1+"'  height='115'>";



																}



																if(show1=="bot")



																{

																document.getElementById('show2').style.display="block";

																document.getElementById('show2').innerHTML="<img src='admin/add_img_upload/main/"+img1+"' height='115'>";



																}



															}



															else



															{



																if(show1=="top")



																	{	

																	document.getElementById('show1').style.display="block";

																	document.getElementById('show1').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"' style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



																	}



																	if(show1=="bot")



																	{

																	document.getElementById('show2').style.display="block";		

																	document.getElementById('show2').innerHTML="<a href=http://"+url1+"><img src='admin/add_img_upload/main/"+img1+"'  style=\"cursor:pointer\" border=\"none\"  height='115'></a>";



																	}



													}



											



											}



											



										} 



									



				 				}



			} 

			if(zxmlHttp22.readyState==0 ||zxmlHttp22.readyState==1 ||zxmlHttp22.readyState==2 ||zxmlHttp22.readyState==3)

			{

				document.getElementById("grayPopup").style.display = 'block';

				document.getElementById("divwaiting").style.display = 'block';

			}



	} 



function move_pan()

{

		document.getElementById("grayPopup").style.display = 'block';

		document.getElementById("divwaiting").style.display = 'block';

		event_search();

		

}



function pagination(n)

{

	pagenum=n;

	show_grid();

}



function tab_search(id)

{

	ORDER = 'ASC';

	for(var tmp=1; tmp<4; tmp++)

	{

		var atr_id = 'tab_'+tmp;

		var span_id = 'tab_'+tmp;

		if(tmp==1)

			var tab_name = 'Most Recent&nbsp;&nbsp;';

		if(tmp==2)

			var tab_name = 'Most Commented&nbsp;&nbsp;';

		if(tmp==3)

			var tab_name = 'Highest Rated&nbsp;&nbsp;';

		if(tmp != id)

		{

			document.getElementById(atr_id).setAttribute( (document.all ? 'className' : 'class'),"");

			document.getElementById(span_id).innerHTML = '<a href="javascript:void(1);" onclick="tab_search('+tmp+');">'+tab_name+'</a>';	

		}

		else

		{

			document.getElementById(atr_id).setAttribute((document.all ? 'className' : 'class'),"selected");

			document.getElementById(span_id).innerHTML = '<a href="javascript:void(1);" onclick="tab_order(\'DESC\');">'+tab_name+'<img src="imag/arrow_bottom.gif" alt="" /></a>';

		}

	}

	

	ID = id;

	show_on_map();

	

}



function tab_order(od)

{

	ORDER = od;

	span_id = 'tab_'+ID;

	if(ID==1)

		var tab_name = 'Most Recent&nbsp;&nbsp;';

	if(ID==2)

		var tab_name = 'Most Commented&nbsp;&nbsp;';

	if(ID==3)

		var tab_name = 'Highest Rated&nbsp;&nbsp;';

	if(od == 'ASC')

		document.getElementById(span_id).innerHTML = '<a href="javascript:void(0);" onclick="tab_order(\'DESC\');">'+tab_name+'<img src="imag/arrow_bottom.gif" alt="" /></a>';

	else

		document.getElementById(span_id).innerHTML = '<a href="javascript:void(0);" onclick="tab_order(\'ASC\');">'+tab_name+'<img src="imag/arrow_upper.gif" alt="" /></a>';

		pagenum=1;

		show_grid();

		

		

}



function commonser()



 {



		var ftype1=document.getElementById('pftype1').checked;



		var ftype2=document.getElementById('pftype2').checked;



		var ftype3=document.getElementById('pftype3').checked;



		var ftype4=document.getElementById('pftype4').checked;



		var ftype5=document.getElementById('pftype5').checked;



		var ftype6=document.getElementById('pftype6').checked;



		var ftype7=document.getElementById('pftype7').checked;



		var ftype8=document.getElementById('pftype8').checked;



		var ftype9=document.getElementById('pftype9').checked;



		var ftype10=document.getElementById('pftype10').checked;



		var ftype11=document.getElementById('pftype11').checked;



		



		var wtype1=document.getElementById('pwtype1').checked;



		var wtype2=document.getElementById('pwtype2').checked;



		var wtype3=document.getElementById('pwtype3').checked;



		var wtype4=document.getElementById('pwtype4').checked;



		var wtype5=document.getElementById('pwtype5').checked;



		var wtype6=document.getElementById('pwtype6').checked;



		var wtype7=document.getElementById('pwtype7').checked;



		var wtype8=document.getElementById('pwtype8').checked;



		



		var stype1=document.getElementById('pstype1').checked;



		var stype2=document.getElementById('pstype2').checked;



		var stype3=document.getElementById('pstype3').checked;



		var stype4=document.getElementById('pstype4').checked;



		var stype5=document.getElementById('pstype5').checked;



		var stype6=document.getElementById('pstype6').checked;



		var stype7=document.getElementById('pstype7').checked;



		var stype8=document.getElementById('pstype8').checked;



		var stype9=document.getElementById('pstype9').checked;



		var stype10=document.getElementById('pstype10').checked;



		var stype11=document.getElementById('pstype11').checked;



		var stype12=document.getElementById('pstype12').checked;



		var stype13=document.getElementById('pstype13').checked;



		var stype14=document.getElementById('pstype14').checked;



		var stype15=document.getElementById('pstype15').checked;



		var stype16=document.getElementById('pstype16').checked;



		var stype17=document.getElementById('pstype17').checked;



		var stype18=document.getElementById('pstype18').checked;



		var stype19=document.getElementById('pstype19').checked;



		



		var gtype1=document.getElementById('pgtype1').checked;



		var gtype2=document.getElementById('pgtype2').checked;



		var gtype3=document.getElementById('pgtype3').checked;



		var gtype4=document.getElementById('pgtype4').checked;



		var gtype5=document.getElementById('pgtype5').checked;



		var gtype6=document.getElementById('pgtype6').checked;



		var gtype7=document.getElementById('pgtype7').checked;



		var gtype8=document.getElementById('pgtype8').checked;



	



		var iamtype1=document.getElementById('piamtype1').checked;



		var iamtype2=document.getElementById('piamtype2').checked;



		var iamtype3=document.getElementById('piamtype3').checked;



		var iamtype4=document.getElementById('piamtype4').checked;



		var iamtype5=document.getElementById('piamtype5').checked;



		var iamtype6=document.getElementById('piamtype6').checked;



		var iamtype7=document.getElementById('piamtype7').checked;



		var iamtype8=document.getElementById('piamtype8').checked;



		var iamtype9=document.getElementById('piamtype9').checked;



		var iamtype10=document.getElementById('piamtype10').checked;



		var iamtype11=document.getElementById('piamtype11').checked;



	var url="rq="+3;



		url=url+"&f1="+ftype1;



		url=url+"&f2="+ftype2;



		url=url+"&f3="+ftype3;



		url=url+"&f4="+ftype4;



		url=url+"&f5="+ftype5;



		url=url+"&f6="+ftype6;



		url=url+"&f7="+ftype7;



		url=url+"&f8="+ftype8;



		url=url+"&f9="+ftype9;



		url=url+"&f10="+ftype10;



		url=url+"&f11="+ftype11;



		url=url+"&w1="+wtype1;



		url=url+"&w2="+wtype2;



		url=url+"&w3="+wtype3;



		url=url+"&w4="+wtype4;



		url=url+"&w5="+wtype5;



		url=url+"&w6="+wtype6;



		url=url+"&w7="+wtype7;



		url=url+"&w8="+wtype8;



		url=url+"&s1="+stype1;



		url=url+"&s2="+stype2;



		url=url+"&s3="+stype3;



		url=url+"&s4="+stype4;



		url=url+"&s5="+stype5;



		url=url+"&s6="+stype6;



		url=url+"&s7="+stype7;



		url=url+"&s8="+stype8;



		url=url+"&s9="+stype9;



		url=url+"&s10="+stype10;



		url=url+"&s11="+stype11;



		url=url+"&s12="+stype12;



		url=url+"&s13="+stype13;



		url=url+"&s14="+stype14;



		url=url+"&s15="+stype15;



		url=url+"&s16="+stype16;



		url=url+"&s17="+stype17;



		url=url+"&s18="+stype18;



		url=url+"&s19="+stype19;



		url=url+"&g1="+gtype1;



		url=url+"&g2="+gtype2;



		url=url+"&g3="+gtype3;



		url=url+"&g4="+gtype4;



		url=url+"&g5="+gtype5;



		url=url+"&g6="+gtype6;



		url=url+"&g7="+gtype7;



		url=url+"&g8="+gtype8;



		url=url+"&iam1="+iamtype1;



		url=url+"&iam2="+iamtype2;



		url=url+"&iam3="+iamtype3;



		url=url+"&iam4="+iamtype4;



		url=url+"&iam5="+iamtype5;



		url=url+"&iam6="+iamtype6;



		url=url+"&iam7="+iamtype7;



		url=url+"&iam8="+iamtype8;



		url=url+"&iam9="+iamtype9;



		url=url+"&iam10="+iamtype10;



		url=url+"&iam11="+iamtype11;



		url=url+"&q1="+x1;



		url=url+"&q2="+y1;



		url=url+"&q3="+x2;



		url=url+"&q4="+y2;



		url=url+"&c="+Math.random();



		search_rec_ajax_zoom(url); 



 }





function serbytitle()

{

		TYPE_SER=true;

		var ser=document.getElementById('sertitle').value;

		if(ser=="")

		{

		alert("Search cannot be blank.");	

		}

		else

		{

		var url = "rq="+4;



		url=url+"&ser="+ser;



		url=url+"&c="+Math.random();

GEvent.removeListener(Move_span);

Move_span=null;

//alert(Move_span);

		search_rec_ajax_zoom(url); 

		}

}





///////////////////enter function for geo search in index page //////////////////////////////







function checkEnter(e){ //e is event object passed from function invocation







var characterCode //literal character code will be stored in this variable







if(e && e.which){ //if which property of event object is supported (NN4)



e = e



characterCode = e.which //character code is contained in NN4's which property



}



else{



e = event



characterCode = e.keyCode //character code is contained in IE's keyCode property



}







if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)



//alert("manishj");



geosearch();



return false



}



else{



return true



}







}







//////////////////////////////////////////////////////////



///////////////////enter function for  search in index page //////////////////////////////







function checkEnter1(e){ //e is event object passed from function invocation







var characterCode //literal character code will be stored in this variable







if(e && e.which){ //if which property of event object is supported (NN4)



e = e



characterCode = e.which //character code is contained in NN4's which property



}



else{



e = event



characterCode = e.keyCode //character code is contained in IE's keyCode property



}







if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)



//alert("manishj");



serbytitle();



return false



}



else{



return true



}







}



///////////////////enter function for  search in index page //////////////////////////////







function checkEnter2(e){ //e is event object passed from function invocation







var characterCode //literal character code will be stored in this variable







if(e && e.which){ //if which property of event object is supported (NN4)



e = e



characterCode = e.which //character code is contained in NN4's which property



}



else{



e = event



characterCode = e.keyCode //character code is contained in IE's keyCode property



}







if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)



//alert("manishj");



login();



return false



}



else{



return true



}







}



////////////////////////////////////function for geocode of index page/////////////////////////////////////////



function geosearch()



	{



			var address = document.getElementById('geoser').value;



			geocoder.getLocations(address, addAddressToMap2);



	}



function addAddressToMap2(response) 



		{



	

				if (!response || response.Status.code != 200) 



					{



						//alert("Geocode not possible");

						document.getElementById('popdivindex').innerHTML='Enter the correct location.';

						setTimeout("funhide_record();",5000);



					} 



					 else 



					 {



						place = response.Placemark[0];



						point = new GLatLng(place.Point.coordinates[1],



						place.Point.coordinates[0]);



					zoomlevel=6;

						map.setCenter(point, 6);

						

				}



		}





function leftimg(rec)



{



		



		var url="lraddshow.php";



		url=url+"?rq="+1;



		url=url+"&q1="+x1;



		url=url+"&q2="+y1;



		url=url+"&q3="+x2;



		url=url+"&q4="+y2;



		url=url+"&q5="+zoomlevel;



		url=url+"&q6="+rec;



		url=url+"&c="+Math.random();



		showaleft(url); 



}



var zxmlHttp99;



function showaleft(url)



	{



	



		zxmlHttp99 = GetXmlHttpObject();



		if (zxmlHttp99==null)



			{



				alert ("Browser does not support HTTP Request")



				return



			} 



		zxmlHttp99.onreadystatechange=stateChangedleft;



		zxmlHttp99.open("GET",url,true);



		zxmlHttp99.send(null);







	}



	



function stateChangedleft() 



	{ 



		if (zxmlHttp99.readyState==4 || zxmlHttp99.readyState=="complete")



			{ 

			document.getElementById("grayPopup").style.display = 'none';

			document.getElementById("divwaiting").style.display = 'none';



			var datanode5 =  zxmlHttp99.responseText;



			//alert("hi"+datanode5);



			document.getElementById('show3').innerHTML=datanode5;



			}

			if(zxmlHttp99.readyState==0 ||zxmlHttp99.readyState==1 ||zxmlHttp99.readyState==2 ||zxmlHttp99.readyState==3 )

			{

				document.getElementById("grayPopup").style.display = 'block';

				document.getElementById("divwaiting").style.display = 'block';

			}



	}

	

function rightimg(rec)



{



		var url="rightaddshow.php";



		url=url+"?rq="+1;



		url=url+"&q1="+x1;



		url=url+"&q2="+y1;



		url=url+"&q3="+x2;



		url=url+"&q4="+y2;



		url=url+"&q5="+zoomlevel;



		url=url+"&q6="+rec;



		url=url+"&c="+Math.random();

		showaright(url); 



}



var zxmlHttp98=null;



function showaright(url)



	{

		zxmlHttp98 = GetXmlHttpObject();



		if (zxmlHttp98==null)



			{



				alert ("Browser does not support HTTP Request")



				return



			} 



		zxmlHttp98.onreadystatechange=stateChangedright;



		zxmlHttp98.open("GET",url,true);



		zxmlHttp98.send(null);







	}



	



function stateChangedright() 



	{ 



		if (zxmlHttp98.readyState==4 || zxmlHttp98.readyState=="complete")



			{ 

			document.getElementById("grayPopup").style.display = 'none';

			document.getElementById("divwaiting").style.display = 'none';



			var datanode6 =  zxmlHttp98.responseText;



			document.getElementById('show4').innerHTML=datanode6;



			}

		if (zxmlHttp98.readyState==0 || zxmlHttp98.readyState==1 || zxmlHttp98.readyState==2 || zxmlHttp98.readyState==3 )

		{

			document.getElementById("grayPopup").style.display = 'block';

			document.getElementById("divwaiting").style.display = 'block';

		}

			



	}





var z=0;



function chghd()



{



	if(z==0)

	

	{

	

		document.getElementById('showhead').style.display="none";

		

		document.getElementById('showhead1').style.display="block";

	

	z=1;

	

	}



	else

	

	{

	

		document.getElementById('showhead').style.display="block";

		

		document.getElementById('showhead1').style.display="none";

	

	z=0;	

	

	}



}





function cleardata()



{



document.getElementById('pftype1').checked="";



document.getElementById('pftype2').checked="";



document.getElementById('pftype3').checked="";



document.getElementById('pftype4').checked="";



document.getElementById('pftype5').checked="";



document.getElementById('pftype6').checked="";



document.getElementById('pftype7').checked="";



document.getElementById('pftype8').checked="";



document.getElementById('pftype9').checked="";



document.getElementById('pftype10').checked="";



document.getElementById('pftype11').checked="";



document.getElementById('pwtype1').checked="";



document.getElementById('pwtype2').checked="";



document.getElementById('pwtype3').checked="";



document.getElementById('pwtype4').checked="";



document.getElementById('pwtype5').checked="";



document.getElementById('pwtype6').checked="";



document.getElementById('pwtype7').checked="";



document.getElementById('pwtype8').checked="";



document.getElementById('pgtype1').checked="";



document.getElementById('pgtype2').checked="";



document.getElementById('pgtype3').checked="";



document.getElementById('pgtype4').checked="";



document.getElementById('pgtype5').checked="";



document.getElementById('pgtype6').checked="";



document.getElementById('pgtype7').checked="";



document.getElementById('pgtype8').checked="";



document.getElementById('piamtype1').checked="";



document.getElementById('piamtype2').checked="";



document.getElementById('piamtype3').checked="";



document.getElementById('piamtype4').checked="";



document.getElementById('piamtype5').checked="";



document.getElementById('piamtype6').checked="";



document.getElementById('piamtype7').checked="";



document.getElementById('piamtype8').checked="";



document.getElementById('piamtype9').checked="";



document.getElementById('piamtype10').checked="";



document.getElementById('piamtype11').checked="";



document.getElementById('pstype1').checked="";



document.getElementById('pstype2').checked="";



document.getElementById('pstype3').checked="";



document.getElementById('pstype4').checked="";



document.getElementById('pstype5').checked="";



document.getElementById('pstype6').checked="";



document.getElementById('pstype7').checked="";



document.getElementById('pstype8').checked="";



document.getElementById('pstype9').checked="";



document.getElementById('pstype10').checked="";



document.getElementById('pstype11').checked="";



document.getElementById('pstype12').checked="";



document.getElementById('pstype13').checked="";



document.getElementById('pstype14').checked="";



document.getElementById('pstype15').checked="";



document.getElementById('pstype16').checked="";



document.getElementById('pstype17').checked="";



document.getElementById('pstype18').checked="";



document.getElementById('pstype19').checked="";







document.getElementById('sertitle').value="";



}











var temp1=0;

function Fishing_section()



{

	

	if(temp1==0)

	{

	document.getElementById('bsec1').style.display="block";

	temp1=1;

	}

	else

	{

	document.getElementById('bsec1').style.display="none";

	temp1=0;

	}



}

var temp2=0;

function Water_section()



{



	if(temp2==0)

	{

	document.getElementById('bsec2').style.display="block";

	temp2=1;

	}

	else

	{

	document.getElementById('bsec2').style.display="none";

	temp2=0;

	}

}



var temp3=0;

function Group_fishing()



{



	if(temp3==0)

	{

	document.getElementById('bsec3').style.display="block";

	temp3=1;

	}

	else

	{

	document.getElementById('bsec3').style.display="none";

	temp3=0;

	}



}

var temp4=0;

function iam_fishing()



{



	if(temp4==0)

	{

	document.getElementById('bsec4').style.display="block";

	temp4=1;

	}

	else

	{

	document.getElementById('bsec4').style.display="none";

	temp4=0;

	}

}

var temp5=0;

function species_fishing()



{



	if(temp5==0)

	{

	document.getElementById('bsec5').style.display="block";

	temp5=1;

	}

	else

	{

	document.getElementById('bsec5').style.display="none";

	temp5=0;

	}



}







function cleartext(a)



{



document.getElementById(a).value="";



}



///////////////function for user to invite ur friend/////////////////////////////////////////



function invite(pid,uid)



{







pids=pid;



uids=uid;

document.getElementById("emaildiv").style.display ="block"; 

ScrollDIv('emaildiv',340,230);



/*if(d==120)



{



//	alert("120");



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 400+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";







document.getElementById("emaildiv").style.display ="block"; 	



}



if(d==240)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 500+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==360)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 600+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}



if(d==360)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 600+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==480)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 700+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==600)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 800+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==720)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 900+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==840)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top =1000+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==960)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 1100+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}







if(d==1080)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 1200+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}



if(d==1200)



{



document.getElementById("emaildiv").style.position = "";



document.getElementById("emaildiv").style.top = 1250+"px"; 	



document.getElementById("emaildiv").style.position = "absolute";



document.getElementById("emaildiv").style.display ="block"; 



document.getElementById("emaildiv").style.display ="block"; 	



}*/



}



// this function check the email validation.



function emailsigup(e)



{



  e = (e.toLowerCase());



  if (e == '')



    return EMAIL_BLANK;



  regex = /^\s*[a-z0-9-+\_\.]+@[a-z0-9-_\.]+\.[a-z]{2,4}\s*$/;



  if(!regex.test(e))



    return EMAIL_BAD_SYNTAX;



  return EMAIL_OK;



}

function emailinvite()



{



	var setvalidation =0;



var msg=document.getElementById('msgemail').value;



var email=document.getElementById('emailedit').value;







	



	 if (email == '')



    			{



    



	   				alert('Please enter an email address.');



      			  	



					var setvalidation = 1;



					return false;



				



    			}



			if (emailsigup(email) == EMAIL_BAD_SYNTAX)



 				 {



  				alert( 'Please enter a valid email address, such as name@domain.com.');



  				



			   var setvalidation = 1;



			   return false;



				 }



 		



  			



   				if(setvalidation==0)



					{



						var url="inviteemail.php";



							url=url+"?rq="+1;



							url=url+"&q1="+pids;



							url=url+"&q2="+uids;



							url=url+"&q3="+email;



							url=url+"&q4="+msg;



							url=url+"&sid="+Math.random();



							//	alert(url);



							getinvite(url);



					}



	



				



}



var zxmlHttp9;



 function getinvite(url)



{



	zxmlHttp9=GetXmlHttpObject();



//	alert(zxmlHttp9);					



	if (zxmlHttp9==null)



	{



		alert ("Browser does not support HTTP Request");



		return;



	} 







   zxmlHttp9.onreadystatechange=stateChangedinvite;



   zxmlHttp9.open("GET",url,true);



   zxmlHttp9.send(null);







}



function stateChangedinvite() 



					{ 



						if (zxmlHttp9.readyState==4 || zxmlHttp9.readyState=="complete")



							{ 	

							

							document.getElementById("grayPopup").style.display = 'none';

							document.getElementById("divwaiting").style.display = 'none';



							var datanode1 =  zxmlHttp9.responseText;



							document.getElementById("emaildiv").style.display ="none"; 

							//alert(datanode1);

/*

							if(datanode1 == 1)



							{

*/

								location.href="Msg.php?rq=10";



							/*}*/



							/*if(datanode1 == 0)



							{



								location.href="Msg.php?rq=9";



							}*/



							



							//document.getElementById('ajaxcontentarea').innerHTML = datanode1;							    



							//loadmap2();



							



							}

							if(zxmlHttp9.readyState==0 || zxmlHttp9.readyState==1 || zxmlHttp9.readyState==2 || zxmlHttp9.readyState==3 )

							{

								document.getElementById("grayPopup").style.display = 'block';

								document.getElementById("divwaiting").style.display = 'block';



							}



					}



	

	

	////////////////////////////////////////////////paypal section///////////////////////////////////////



function myfun()

	{

	var a=document.getElementById('method').value;

//	alert(a);

	if(a==0)

	{

	document.getElementById('a2').innerHTML="0";

	document.getElementById('a3').innerHTML="0";

	temp_amout=0;

	}

	if(a==2.99)

	{

	document.getElementById('a2').innerHTML="2.99";

	document.getElementById('a3').innerHTML="2.99";

	temp_amout=2.99;

	}

	if(a==9.75)

	{

	document.getElementById('a2').innerHTML="9.75";

	document.getElementById('a3').innerHTML="9.75";

	temp_amout=9.75;

	}

	if(a==17.50)

	{

	document.getElementById('a2').innerHTML="17.50";

	document.getElementById('a3').innerHTML="17.50";

	temp_amout=17.50;

	}

	}

function myfuncall()

{

var a=document.getElementById('method').value;	



if(a==2.99 || a==9.75 || a==17.50)

{

location.href="billingdetail.php?temp_a="+temp_amout+"&temp_b="+a+"";

}

else

{

alert("Select Any One Shipping Method");	

} 

}



function myfuncalltogo(g)

{



	

	document.g.submit();



}



function funupdate(k)

{

//	alert(k);

	var lname=document.getElementById('slnameuser').value;

var fname=document.getElementById('sfnameuser').value;

var address=document.getElementById('sadduser').value;

var zipcode=document.getElementById('szipuser').value;

var state=document.getElementById('sstateuser').value;

var city=document.getElementById('scityuser').value;

//var count=document.getElementById('scountryuser').value;

	

	if(lname=="")

	{

	alert("Last name cannot be blank.");	

	document.getElementById('slnameuser').focus();

	 temp_user_var=1;

	return false;

	}

	else

	{

	 temp_user_var=0;

	}

	if(fname=="")

	{

	alert("First name cannot be blank.");	

	document.getElementById('sfnameuser').focus();

	 temp_user_var=1;

	return false;

	}else

	{

	 temp_user_var=0;

	}

	if(address=="")

	{

	alert("Address cannot be blank.");	

	document.getElementById('sadduser').focus();

	 temp_user_var=1;

	return false;

	}else

	{

	 temp_user_var=0;

	}

	if(zipcode=="")

	{

	alert("Zip code cannot be blank.");	

	document.getElementById('szipuser').focus();

	 temp_user_var=1;

	return false;

	}else

	{

	 temp_user_var=0;

	}

	if(state=="")

	{

	alert("State cannot be blank.");	

	document.getElementById('sstateuser').focus();

	 temp_user_var=1;

	return false;

	}else

	{

	 temp_user_var=0;

	}

	if(city=="")

	{

	alert("City cannot be blank.");	

	document.getElementById('scityuser').focus();

	 temp_user_var=1;

	return false;

	}else

	{

	 temp_user_var=0;

	}

	//alert(temp_user_var);

	if(temp_user_var==0)

		{

		document.k.submit();

		}

	

	

}



function samebilling()

{

var shiping=document.getElementById('shiping').checked;

if(shiping==true)

{

document.getElementById('emailuser').value=document.getElementById('semailuser').value;

document.getElementById('lnameuser').value=document.getElementById('slnameuser').value;

document.getElementById('fnameuser').value=document.getElementById('sfnameuser').value;

document.getElementById('Company').value=document.getElementById('sCompany').value;

document.getElementById('Title').value=document.getElementById('sTitle').value;

document.getElementById('weburl').value=document.getElementById('sweburl').value;

document.getElementById('phone').value=document.getElementById('sphone').value;

document.getElementById('adduser').value=document.getElementById('sadduser').value;

document.getElementById('appu').value=document.getElementById('sappu').value;

document.getElementById('zipuser').value=document.getElementById('szipuser').value;

document.getElementById('stateuser').value=document.getElementById('sstateuser').value;

document.getElementById('cityuser').value=document.getElementById('scityuser').value;

document.getElementById('countryuser').value=document.getElementById('scountryuser').value;

}

}





/////////////////////function for check to user add at least single fishing spot //////////////////////////////////



function userSpot()

{	

	var url="signup.php";

	url=url+"?rq="+10;

	url=url+"&sid="+Math.random();

	getuserspot(url);

		

}



var zxmlHttp125456;

 function getuserspot(url)

{

	zxmlHttp125456=GetXmlHttpObject();

	if (zxmlHttp125456==null)

	{

		alert ("Browser does not support HTTP Request");

		return;

	} 



   zxmlHttp125456.onreadystatechange=stateChangeduserspot;

   zxmlHttp125456.open("GET",url,true);

   zxmlHttp125456.send(null);



}

function stateChangeduserspot() 

					{ 

						if (zxmlHttp125456.readyState==4 || zxmlHttp125456.readyState=="complete")

							{ 	

							document.getElementById("grayPopup").style.display = 'none';

							document.getElementById("divwaiting").style.display = 'none';

							var datanode1 =  zxmlHttp125456.responseText;

							//alert(datanode1);

							if(datanode1==0)

							{

							location.href="orderdetail.php";

							}

							else

							{

							alert("You must add at least one fishing spot before you can get a free fishing lure. Do this quickly from the home page and then return here!");

							}

							}

							if(zxmlHttp125456.readyState==0 ||zxmlHttp125456.readyState==1 ||zxmlHttp125456.readyState==2 ||zxmlHttp125456.readyState==3)

							{

								document.getElementById("grayPopup").style.display = 'block';

								document.getElementById("divwaiting").style.display = 'block';

							}

					}

////////////////////////////end//////////////////////////////////////////////////////			