// JavaScript Document yakub

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//=================================================================================================
function TrimString(sInString) {
  sInString = sInString.replace( /^\s+/g, "" );// strip leading
  return sInString.replace( /\s+$/g, "" );// strip trailing
}
function stopval()
{
document.frmAdvSearchform.txtsearch1.value=stopKeyword(document.frmAdvSearchform.txtsearch1.value)
}
function changeval(argKey)
{
//alert(argKey);
var orientation = ""
document.forms[0].hi1.value=document.forms[0].txtsearch1.value;
//alert(document.forms[0].hi1.value);
//document.forms[0].txtsearch.value=stopKeyword(document.forms[0].txtsearch1.value);
for(var i=0; i < document.frmAdvSearchform.chkOrientation.length; i++)
 {

   if(document.frmAdvSearchform.chkOrientation[i].checked)
   orientation +=document.frmAdvSearchform.chkOrientation[i].value + " "
     	
 }
 if (document.frmAdvSearchform.chkOrientation[0].checked && document.frmAdvSearchform.chkOrientation[1].checked)
  {
  //alert(orientation);
   orientation="";
   }
  
  if (argKey)
    {
	  document.getElementById("txtsearch").value=stopKeyword(TrimString(document.getElementById("txtsearch1").value));
	}
  else
    {
	var keywords;
	keywords=TrimString(stopKeyword(document.getElementById("txtsearch1").value)) + " " + TrimString(orientation) + " " + TrimString(document.getElementById("ddlNoPeople").value) + " " +  TrimString(document.getElementById("select1").value);
	  document.getElementById("txtsearch").value= keywords.replace("  "," ")
	
	}



document.forms[0].chid.value = '';
if(document.forms[0].searchwithin.checked==true)
{
document.forms[0].txtsearch.value='<%=trim(session("txtsearch"))%>' + " " + stopKeyword(document.forms[0].txtsearch1.value);
document.forms[0].hi1.value='<%=trim(session("searcon"))%>' + " " + document.forms[0].txtsearch1.value
document.forms[0].hflag.value=0;
}

else
document.forms[0].hflag.value=0;
//alert(document.forms[0].txtsearch.value);
document.frmAdvSearchform.submit();
}
function changeval2()
{
window.location="advancesearchresult.aspx?imgperpage=24&idsearch=" + document.forms[0].txtsearchid2.value;
}
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}



function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function showSearchPnl(div1,arg)
{

if (arg)
{
 if(document.getElementById(div1).style.display == "block")
  {   
 // alert(document.getElementById(div1).style.display);
    document.getElementById(div1).style.display = "none";
  }
 
 }
 else
    document.getElementById(div1).style.display = "block";
}



//=================================================================================================
function stopKeyword(s)
{
	keywords=new Array(".","a","$","&",";",",","?","no","0","6","7","8","9","#","-","+","*","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","at","above","ad",",ads","age","ages","all","along","among","an","and","are","as","behind","being","beings","below","besides","body","bodies","both","but","clothing","cloth","clothes","clad","does","down","dress","dresses","each","eight","either","few","find","from","front","get","garment","garments","had","has","have","having","id","if","into","is","isn","it","last","life","like","moods","much","must","new","next","of","on","ours","outfits","outfit","over","pc","Photo","persons","photos","photographs","pictures","picture","pic","pics","pix","same","shoot","shoots","shots","shot","site","so","still","stock","ten","text","than","that","the","their","them","through","towards","under","up","using","viewed","very","wala","wear","wearing","website","whose","with","within","without","year","years","in","able","about","after","again","almost","already","also","although","am","another","any","around","based","be","because","been","before","being","between","both","bring","but","by","came","can","com","come","comes","could","collection","collections","did","do","does","doing","done","each","eight","else","ethnicity","even","every","f","for","from","g","get","gets","getting","go","going","got","h","had","has","have","he","her","here","him","himself","his","how","however","i","if","in","including","into","is","it","its","j","just","k","kb","know","l","like","looks","m","make","making","many","may","mb","me","means","might","more","most","move","mr","much","must","my","n","need","needs","never","nice","nine","no","not","now","o","of","often","oh","ok","on","or","org","other","our","out","over","own","p","piece","q","r","rather","re","really","s","said","same","say","says","see","seven","several","she","should","since","six","so","some","something","still","stuff","such","t","take","ten","than","that","the","their","them","then","there","these","they","thing","things","this","those","through","to","too","took","u","under","up","us","use","used","using","usual","v","ve","very","via","view","w","want","was","way","we","well","were","what","when","where","whether","which","while","whilst","who","why","will","with","within","would","x","y","yes","yet","you","your","putting","giving","give","taking","take","near","ups","small","big","dressing");
	var wrd,str,i,j,flag;
	j=-1;
	str="";
	while(j<s.length)
	{
		wrd="";
		j++;
		for(;j<s.length;j++)
		{
			ch=s.charAt(j);
			if(ch==' '||ch=='&'||ch==';'||ch==','||ch=='#')
				break;
			wrd=wrd+ch;
		}
		flag=0;
		for(i=0;i<keywords.length;i++)
		{
			if(wrd.toLowerCase()==keywords[i].toLowerCase())
			{
				flag=1;
				break;
			}
		}
		if(flag==0)
			str=str+wrd+" ";
	}
	return (str);
}
