function getSearch()
{
	obj=document.frmsearch;
	
	if(obj.txtcategory.value=="")
	{
		alert("Please enter search text");
		obj.txtcategory.focus();
		return false;
	}
	
	return true;
}

function countstringno()
{

	obj=document.myform;

	lenth=obj.txtcomments.value;
	len=lenth.length+1;
	obj.txtcount.value=1000-len;
	
	if((1000-len)<=0)
	{
		obj.txtcount.value =0;
		alert("You can not fedd more data, Data limit is 1000 characters" )
		obj.txtcomments.value = obj.txtcomments.value.substr(0,995);
		

		return;
	}
	

}

function validcomments()
{
	

	//obj=document.myform.txtcountry;
   // if(isEmpty(obj,"Country Name"))
        //return false;


	obj=document.myform.txtname;
	
    if(isEmpty(obj,"Name"))
        return false;
	
	 obj=document.myform.txtemail
	 if(obj.value!="")
	 {
		 if (! isValidEmail(obj.value))
		 {
			alert("Invalid e-Mail-Id entered.");
			obj.focus();
			return false;
		 }
	 }

	  obj=document.myform.txtcomments
		if(isEmpty(obj,"Comments"))
		return false;
   
	return true;
   
}

function expond(id,sign)
{
	
	obj=document.myform;
	objA=document.getElementById("com1"+id);
	objB=document.getElementById("com100"+id);
	objplus=document.getElementById("img1"+id);
	objminus=document.getElementById("img100"+id);

	if(sign=='1')
	{
		objplus.style.display = "none";
		objminus.style.display = "block";
		objA.style.display="none";
		objB.style.display="block";
	}
	if(sign=='-1')
	{
		objplus.style.display = "block";
		objminus.style.display = "none";
		objA.style.display="block";
		objB.style.display="none";
	}

	


}

function changesize(size)
{
}

function newspaging(check)
{
	obj=document.pagingform;
	
	if(check==1)
	{
		if(obj.nextpageno.value < parseInt(obj.totalpages.value)-1)
			obj.nextpageno.value=parseInt(obj.nextpageno.value)+1;
	}
	else
	{
		obj.nextpageno.value=parseInt(obj.nextpageno.value)-1

	}

	
	for(j=0; j<obj.totalpages.value; j++)
	{
		objB=document.getElementById("n"+j);
		objB.style.display="none";
	}

	if(check=="1")
		objA=document.getElementById("n"+obj.nextpageno.value);
	else
		objA=document.getElementById("n"+obj.backpageno.value);

		objA.style.display="block";

	objBack=document.getElementById("back");
	objNext=document.getElementById("next");
	if(obj.nextpageno.value>0)
	{
		objBack.style.display="block";
		obj.backpageno.value=parseInt(obj.nextpageno.value-1);

	}
	else
	{
		objBack.style.display="none";
	}
	

	if(obj.nextpageno.value==parseInt(obj.totalpages.value)-1)
	{
		objNext.style.display="none";
	}
	else
	{
		objNext.style.display="block";
	}
	
}
function onload()
{
	alert();
	objBack=document.getElementById("back");
	objNext=document.getElementById("next");
	objBack.style.display="none";
	objNext.style.display="none";
}
function  validCategoryBox()
{
	obj=document.search.txtcategory;
    if(isEmpty(obj,"Category"))
        return false;

	return true;
}



  function PopWin(myurl)
  {
	  myurl="print"
	var path;
	var title;
	var w;
	var mail="/print/mail.php";
	var pri ="print/printer.php";
	var comment="/print/comment.php";
	path=window.location;
	title=window.document.title;
	  switch (myurl)
	  {
		case ("mail"): docurl = mail + "?title=" + title + "&path=" + path;
		  w = open(docurl,"mail","resizable=no, width=430, height=445, scrollbars=yes, status=no, top=50, left=150, screenX=430, screenY=445");
		  break;
		case ("print"): docurl = pri + "?title=" + title + "&path=" + path;
		  w = open(docurl,"print", "location=no, scrollbars=yes, menubars=no, toolbars=no, resizable=yes, status=no, width=790, height=520, top=0, left=0, screenX=0, screenY=0");
		  break;
		case ("comment"): docurl = comment + "?title=" + title + "&path=" + path;
		  w = open(docurl,"comment","resizable=no, width=400, height=380, scrollbars=no, status=no, top=100, left=150, screenX=400, screenY=380");
	  }
	
	  if(w.opener==null) w.opener= self;
  }


function makemyhomepage()
 {
   mywindow = window.open ("html/makehomepage.html","","location=1,status=1,scrollbars=1, toolbar=Off, menubar=Off, width=700,height=440");
 // mywindow.moveTo(100,500);
 } 

function emailpopup(id)
{
	mywindow = window.open ("emailtofriend.php?NID="+id,"","scrollbars, width=502, height=460, status,toolbar=Off,menubar=Off");
							//window.open('url.htm', 'windowname', 'scrollbars,resizable,status,toolbar,menubar');

}
function validemailpopup()
{

	
	obj=document.forms[0].txtremail;
	
    if(!isValidEmail(obj.value))
	{
		alert("Invalid e-Mail-Id entered.");
		obj.focus();
		return false;
	}
	
	
	obj=document.forms[0].txtyemail;
	if (! isValidEmail(obj.value))
	{
		alert("Invalid e-Mail-Id entered.");
		obj.focus();
		return false;
	}
	
	

	return true;
   
}

function EnimagesPopup()
{
	mywindow = window.open ("http://www.euronews.net/popup.php?lng=2&lien=stream1.euronews.net:8080/ramgen/new/cut/srilanka_53322_2.rm?usehostname","","scrollbars, width=502, height=460, status,toolbar=Off,menubar=Off");
	return false;
							//window.open('url.htm', 'windowname', 'scrollbars,resizable,status,toolbar,menubar');

}

function Reportanabuse()
{
	obj=document.myform;
	obj.action="contact.php"
	obj.submit();
	return;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}

function validContactus()
{


	obj=document.myform;
	
    if(isEmpty(obj.name,"votre Nom"))
        return false;
	
	
	 if(isEmpty(obj.address,"votre address"))
		return false;

	 if (!isValidEmail(obj.email.value))
	 {
			alert("Votre pays de residence.");
			obj.email.focus();
			return false;
	 }
	var flag=false;
	 for(i=0; i<obj.radiobutton.length;i++)
	 {
		 if(obj.radiobutton[i].checked)
		 {
			flag=true;
			break;
		 }
	 }

	  if(flag==false)
	  {
		  alert("Objet de votre message");
		  return false;
	  }
   if(isEmpty(obj.comments,"Commentaires"))
		return false;

	return true;
   
}


function validadvertise()
{


	obj=document.myform;
	
    if(isEmpty(obj.name,"votre Nom"))
        return false;
	
	
	 if(isEmpty(obj.company_name,"compagnie"))
		return false;

	 if (!isValidEmail(obj.email.value))
	 {
			alert("Votre pays de residence.");
			obj.email.focus();
			return false;
	 }
	
   if(isEmpty(obj.message,"Commentaires"))
		return false;

	return true;
   
}

//----------PHOTOGALLARY SCRIPT------------------------------------------//
function SmallWin(id)
{
 // alert("ok");
  window.open("viewlargephoto.php?LID="+id,"","resizable=no,width=540,height=440,scrollbars=yes,status=no,top=75,screenY=255,left=200,screenX=350");
}

