function searchCheck()
{
	var str = '';
	if (document.frm.ss.value=='' || document.frm.ss.value=='Enter Search Keyword...')	{
		alert("Please enter some keyword to search.");
		document.frm.ss.focus();
                document.frm.ss.value='';
		return false;
	}

	if (document.frm.ss.value.length < 3) {
		alert("Please Enter atleast 3 character");
		document.frm.ss.focus();
		return false;
        }

       if (document.frm.ss.value) {
	var str1;
	str1 = document.frm.ss.value.replace(/^\s+/g, '').replace(/\s+$/g, '');
	str1 = str1.replace(/[^a-zA-Z0-9+ ]/g, ' ');
	str1 = str1.replace(/\+/g, ' ');
	str1 = str1.replace(/\s+/g, '+');
	str += 'ss='+str1;
window.location = "http://www.indiamart.com/safeguard/search.html?"+str;
return false;
        }
}

function searchClear()
{
	if (document.frm.ss.value=='Enter Search Keyword...')	{
		document.frm.ss.value='';
	}
}


function settextvalue()
{
	document.frm.ss.value='Enter Search Keyword...';    
}

function getDwsCookie(Name)
{
	var search = Name + "="
	if (document.cookie.length > 0)
	{ // if there are any cookies
		offset = document.cookie.indexOf(search)
		if (offset != -1)
		{ // if cookie exists
			offset += search.length
			// set index of beginning of value
			end = document.cookie.indexOf(";", offset)
			// set index of end of cookie value
			if (end == -1) end = document.cookie.length
			return unescape(document.cookie.substring(offset, end))
		}
	}
	return "";
}

function setDwsCookie(name, value)
{
	expires = new Date();
	expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);

	if (value.length > 0)
	document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString() + ";";

}
function showTradeOfferLink()
{
  if( (cookie = getDwsCookie("ETO_OFFERS")) > "")
   {
      if(cookie != "")
      {
         document.write(' | <a href="tradeoffers.html">Trade Offers ('+cookie+')</a>');
      }
   }
   else
   {
      var surl = "http://www.media4trade.com/tradeofferserver?id=403896&setcookie=1&disp=link";
      document.write('<scr' + 'ipt language="javascript"' + ' src="' + surl + '"></scr' + 'ipt>');
   }
  }
function showTradeOfferCount()
{
   if( (cookie = getDwsCookie("ETO_OFFERS")) > "")
   {
      if(cookie != "")
      {
         document.write(' ('+cookie+')');
      }
   }
}
function showTradeOfferLink2()
{
	document.write(' | <a href="tradeoffers.html">Trade Offers</a>');
}


if (document.images)
{
   pic1= new Image();
   pic1.src="ts/ar1.gif";


   pic2= new Image();
   pic2.src="ts/man1.gif";

   pic3= new Image();
   pic3.src="ts/mbd1.gif";

   pic4= new Image();
   pic4.src="ts/que1.gif";

}
function openchild(sPicURL,h,w)
{
	window.open(sPicURL, 'Lookup', 'toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=no,copyhistory=no,width='+w+',height='+h+'');
}

//for open vidio's
var win = null;

function NewWinIM(mypage,myname,compname)
{var embedcode='';
var arr=mypage.split('/');
if (mypage.search(/heavy\#\#/) != -1){
      mypage = mypage.replace('heavy##','');
      var hw='height=350,width=370';
      var embedcode = '<embed src="http://www.videowebtown.com/community/flvplayer/flvplayer.swf?file=http://www.videowebtown.com/indiamartvideo/video/'+mypage+'.flv&autoStart=false"  quality="high" bgcolor="#ffffff" width="352" height="288" name="movie" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';
}
else{
      var hw='height=350,width=370';
      var embedcode = '<embed src="http://www.4shared.com/flash/flvplayer.swf"   style="width: 400px; height: 326px;" bgcolor="#ffffff" allowscriptaccess="always" allowfullscreen="true" flashvars="file=http://dc152.4shared.com/img/'+arr[0]+'/'+arr[1]+'/dlink__2Fdownload_2F'+arr[0]+'_2F'+arr[1]+'_3Fdsid_3DJGITKOINJZHYGJIAJPJYHXISIQKIJFIVHXHZHYJIIZJBJPIWKSIRKQITIGJTIAGHGCIAHYJHINIQKVKU/preview.flv&amp;image=http://dc152.4shared.com/img/'+mypage+'&amp;autostart=true">';
}
LeftPosition = (screen.width) ? (screen.width-400)/2 : 0;
TopPosition = (screen.height) ? (screen.height-326)/2 : 0;

var settings = 'width=460';
settings += ', height=400';
settings += ', top='+TopPosition+', left='+LeftPosition;
settings += ', directories=no';
settings += ', location=no';
settings += ', menubar=no';
settings += ', resizable=no';
settings += ', scrollbars=no';
settings += ', status=no';
settings += ', toolbar=no';

win = window.open("",myname,settings);
win.document.write('<HTML><HEAD><TITLE>'+compname+' Video</TITLE><LINK HREF="ts/dir_video.css" REL="stylesheet" TYPE="text/css" TITLE="default"></HEAD><BODY BGCOLOR="#ffffff"><DIV style="color:#000000;font-size:11px;font-family:arial" align="center">Video by '+compname+'</DIV><DIV ALIGN="CENTER"><table BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="440"> <tr> <TD><img src="ts/top-left-1.gif"  WIDTH="7" HEIGHT="9"></TD> <TD BACKGROUND="ts/bottom-lcenter.gif"></TD> <TD><img src="ts/top-right-1.gif"  WIDTH="7" HEIGHT="9"></TD> </tr> <tr> <TD BACKGROUND="ts/l-bg1.gif"><img src="zero.gif"  WIDTH="7" HEIGHT="1"></TD> <TD VALIGN="TOP"> <table CELLPADDING="0" CELLSPACING="0" BORDER="0"> <tr> <TD WIDTH="460" HEIGHT="350"> <DIV CLASS="sec-div" STYLE="background-image:url(ts/indicator-new.gif); background-repeat:no-repeat; background-position: center center;padding:10px;" > '+embedcode+'</DIV></TD> </tr> </table></TD> <TD BACKGROUND="ts/l-bg1.gif"><img src="zero.gif"  WIDTH="7" HEIGHT="1"></TD> </tr> <tr> <TD><img src="ts/bottom-left-1.gif"  WIDTH="7" HEIGHT="9"></TD> <TD BACKGROUND="ts/bottom-lcenter.gif"></TD> <TD><img src="ts/bottom-right-1.gif"  WIDTH="7" HEIGHT="9"></TD> </tr> </table> </DIV></BODY></HTML>');
}