function searchCheck()
{
	var str = '';
	if (document.frm.ss.value=='' || document.frm.ss.value=='Search Products/Services')	{
		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();
		document.frm.ss.value='';
		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/yogi/search.html?"+str;
return false;
        }
}

function searchClear()
{
	if (document.frm.ss.value=='Search Products/Services')	{
		document.frm.ss.value='';
	}
}

function settext()
{
	if (document.frm.ss.value=='')  {
		document.frm.ss.value='Search Products/Services';
	}
}

function settextvalue()
{
	document.frm.ss.value='Search Products/Services';
}

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)
{
    if(value.length>0)
        document.cookie=name+"="+escape(value)+";"
}
var persistmenu="yes" //"yes" or "no". Make sure each DIV content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.sb1{display: none;}\n')
document.write('.tbq{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("div"); //DynamicDrive.com change
		if(el.style.display != "inline"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="tbq") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "inline";
		}
	}
}

function SwitchMenu4(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv4").getElementsByTagName("table"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="sb1") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";}
			else{
			el.style.display = "none";
		}
	}
}

// show and hide product name on home page
var plnew = "pl2";
function show(obj, plus, obj1,plus1)
{
        if(document.getElementById)
	{
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv1").getElementsByTagName("div");
		for (var i=0; i<ar.length; i++)
		{
			if(ar[i].className == "on")
			{
				ar[i].className = "off";
			}
		}
		document.getElementById(obj).className = "on";
	}
	if(document.getElementById(plnew))
	{
		document.getElementById(plnew).className = "prd lh1 c10 b p50 a nr b09 m11";
	}
	if(document.getElementById(plus).className == "prd lh1 c10 b p50 a nr b09 m11")
	{
		document.getElementById(plus).className = "pr1 lh1 c10 b p48 a nr m11";
	}
	plnew = plus;
	document.getElementById(obj1).className = "off";
	document.getElementById(plus1).className = "b f2 u c9 txr p51";
}
function show1(obj, plus)
{
	document.getElementById(obj).className = "on";
	document.getElementById(plus).className = "off";
}
function show2(obj, plus)
{
	document.getElementById(obj).className = "b f2 u c9 txr p51";
	document.getElementById(plus).className = "off";
}
/* hide show */
function showcontact(co, im)
{
if (document.getElementById(co).className=="doff")
{
document.getElementById(co).className="don";
document.getElementById(im).src="ts/zero.gif";
document.getElementById(im).className="mn2 im6";
}
else
{
document.getElementById(co).className="doff";
document.getElementById(im).src="ts/zero.gif";
document.getElementById(im).className="mn2 im5";
}
}
/** hide show **/


//-----starting of new js part to open all blowup from a single js-----------------
var myWidthnew=0, myHeightnew=0;
var divscroll,message2,prname,imagediv,blwtbl,mx,mx1;
function bhw_js(val){
if( typeof( window.innerWidth )=='number' ){myWidthnew=window.innerWidth;myHeightnew=window.innerHeight;} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {myWidthnew=document.documentElement.clientWidth;myHeightnew=document.documentElement.clientHeight;} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {myWidthnew=document.body.clientWidth;myHeightnew=document.body.clientHeight;}var h=window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;var browserName=navigator.appName; var imagedivheight=myHeightnew-93;var test=myWidthnew*24/100;var divwidth=myWidthnew-test;var widthformizilla=myWidthnew-538;var mozillawidth=widthformizilla-divwidth;var mozillawidth1=mozillawidth/2;var mtop=h+7;var iewidth=myWidthnew-516;var aboveheight=myHeightnew-584;if (val=="cal"){iewidth=myWidthnew-730;aboveheight=myHeightnew-410;}var iewidth1=iewidth/2;var aboveheight1=aboveheight/2+h;divscroll.style.height="500px";divscroll.style.width="504px";blwtbl.style.height="478px";if (val=="cal"){blwtbl.style.height="320px";divscroll.style.width='730px';divscroll.style.height='335px';}message2.style.top=aboveheight1+'px';message2.style.left=iewidth1+'px';divscroll.name="miniwin";if ((myHeightnew <=586) && (val !="cal")){divscroll.style.height=imagedivheight+'px';divscroll.style.width="522px";blwtbl.style.height=imagedivheight+'px';message2.style.top=mtop+'px';}}function max(){var imagedivheightnew=myHeightnew-93;var imagedivwidthnew=myWidthnew-212;var imagedivheightnew1=myHeightnew-94;var h=window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;var browserName=navigator.appName; var mtop=h+7;if (divscroll.name=="miniwin"){message2.style.left="100px";message2.style.top=mtop+'px';divscroll.style.width=imagedivwidthnew+'px';divscroll.style.height=imagedivheightnew+'px';blwtbl.style.height=imagedivheightnew1+'px';divscroll.name="maxwin";mx.className="doff ";mx1.className="don blow b2";}else{mx.className="don blow bol";mx1.className="doff";bhw_js()}}
function blowup_show_js(){fll();divscroll=document.getElementById('divscroll');message2=document.getElementById('message2');prname=document.getElementById('prname');imagediv=document.getElementById('imagediv');blwtbl=document.getElementById('blwtbl');mx=document.getElementById('mx');mx1=document.getElementById('mx1');divscroll.style.height="";divscroll.style.width=""; var nAgt=navigator.userAgent;var patt=/Chrome/;if(patt.test(nAgt)){}else if(navigator.appName == 'Microsoft Internet Explorer'){document.getElementsByTagName("html")[0].style.overflow="hidden";}else{document.body.style.overflow="hidden";}message2.className="don";mx.className="don blow bol";mx1.className="doff";bhw_js();}
function blowup_show2(){divscroll=document.getElementById('divscroll');message2=document.getElementById('message2');prname=document.getElementById('prname');imagediv=document.getElementById('imagediv');blwtbl=document.getElementById('blwtbl');mx=document.getElementById('mx');mx1=document.getElementById('mx1');divscroll.style.height="";divscroll.style.width="";mx.className="doff";mx1.className="doff"; var nAgt=navigator.userAgent;var patt=/Chrome/;if(patt.test(nAgt)){message2.className="don";bhw_js('cal');}else{document.body.style.overflow="hidden";document.getElementsByTagName("html")[0].style.overflow="hidden";message2.className="don";bhw_js('cal');}}function blowup_off_js(){prname.innerHTML="";message2.className="doff";document.body.style.overflow="";document.getElementsByTagName("html")[0].style.overflow="";document.getElementById('loadimg').className="don";imagediv.className="doff";imagediv.innerHTML="";}var path='';var imgid="0";function imageset(id,imagepath){divscroll=document.getElementById('divscroll');message2=document.getElementById('message2');prname=document.getElementById('prname');imagediv=document.getElementById('imagediv');blwtbl=document.getElementById('blwtbl');mx=document.getElementById('mx');mx1=document.getElementById('mx1');path=imagepath;imgid=id;var pic=document.getElementById(imgid);productName=pic.alt;productName=unescape(productName);if(productName.length > 40){var c=productName.substring(0,40);c=c + "...";productName=c;}imagediv.innerHTML='<img src="'+path+'"   alt="'+productName+'" onload="loadimg()" id="bigimg">';prname.innerHTML=productName;}
function trustseal(path){imagediv.innerHTML='<iframe src="'+path+'"   height="670" width="520" onload="loadimg1();" id="ifrm" FRAMEBORDER="0" MARGINWIDTH="0"></iframe>';divscroll.style.width='550px';blwtbl.style.height="600px";mx.className="doff";mx1.className="doff";}

function NewWinIM(mypage,myname,compname)
{
//alert(compname);
mx=document.getElementById('mx');mx1=document.getElementById('mx1');
imagediv=document.getElementById('imagediv');
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">';
}
//alert(imagediv.class);
prname.innerHTML=compname;
document.getElementById('loadimg').className="doff";
imagediv.className="don";
imagediv.innerHTML=embedcode;
divscroll.style.width='400px';
blwtbl.style.height='200px';
document.getElementById('divscroll').style.height='330px';

mx.className="doff";
mx1.className="doff";
imagediv.className="don";
}
function callfree1(glusr_id,modid)
{if(glusr_id !='' && modid != ''){var url = '/cgi/datetime.pl?supId='+glusr_id+'&modid='+modid;http_request = false;if(window.XMLHttpRequest){http_request = new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/html');}}else if(window.ActiveXObject){try
{http_request = new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try{http_request = new ActiveXObject("Microsoft.XMLHTTP");}catch (e){}}}http_request.onreadystatechange = function() {alertContents(http_request); };http_request.open('GET', url, true);http_request.send(null);}else{alert('There is some technical problem.Please try after some time.');}}
function alertContents(http_request)
{if (http_request.readyState == 4)
{if (http_request.status == 200){var my_result = http_request.responseText;if(my_result == 1)
{alert('There is some technical problem.Please try after some time.');}else
{var strarr = my_result.split("##");comp_nm = strarr[1];comp_nm = comp_nm.replace(/\\'/g,"'");comp_nm = escape(comp_nm);comp_nm='&supCompName='+comp_nm;callpath= strarr[0]+comp_nm;document.getElementById('imagediv').innerHTML='<iframe src="'+callpath+'"   height = "320" width = "718" onload="loadimg1()" FRAMEBORDER="0" MARGINWIDTH="0" SCROLLING="no"></iframe>';document.getElementById('divscroll').style.width='730px';document.getElementById('divscroll').style.height='335px';}}}}

function loadimg(){document.getElementById('loadimg').className="doff";imagediv.className="don";if(document.getElementById('bigimg').height > 500 || document.getElementById('bigimg').width > 500){max();}}
function loadimg1(){document.getElementById('loadimg').className="doff";imagediv.className="don";}document.write('<DIV ID="message2" STYLE="position:absolute;top:0px;left:0px;z-index:2000";ALIGN="center" class="doff"><table ID="tableheight" ALIGN="center" BORDER="0" CELLPADDING="0" CELLSPACING="0"><tr><TD ALIGN="center"><table CLASS="bgclor" BORDER="0" CELLPADDING="0" CELLSPACING="0"><tr><TD ALIGN="center"><table CLASS="blow main" ALIGN="center" BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%" HEIGHT="35"><tr><TD ID="titleBar"STYLE="cursor:move"><ILAYER WIDTH="100%" ONSELECTSTART="return false"> </ILAYER><layer WIDTH="100%" ONMOUSEOVER="isHot=true;if (isN4) ddN4(message2)" ONMOUSEOUT="isHot=false"><DIV ID="prname" CLASS="pr-txt"></DIV></LAYER></TD><TD ALIGN="right" STYLE="padding-right:0px;" WIDTH="100"><table BORDER="0" CELLPADDING="0" CELLSPACING="0"><tr><TD><img src="ts/zero.gif"  id="mx" WIDTH="21" HEIGHT="21" STYLE="cursor:pointer" ONCLICK="max()" HSPACE="2" class="don blow bol"></TD><TD><img src="ts/zero.gif"    id="mx1" WIDTH="21" HEIGHT="21" STYLE="cursor:pointer;" class="doff" ONCLICK="max()" HSPACE="2"></TD><TD><img src="ts/zero.gif"    WIDTH="21" HEIGHT="21" hspace="3" ONCLICK="blowup_off_js()" class="blow clos" STYLE="cursor:pointer"></TD></tr></table></TD></tr></table><DIV CLASS="image_div" ID="divscroll" ALIGN="center"><table ID="blwtbl" ALIGN="center" BGCOLOR="#ffffff" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><tr><TD ALIGN="center"><DIV ID="loadimg" STYLE="font-family:arial;font-size:15px;" class="doon"><img src="ts/indicator-new.gif"    height="36" width="36"><BR><BR>Loading...</DIV><DIV ID="imagediv" class="doff"></DIV></TD></tr></table></DIV></TD></tr></table></TD></tr></table></DIV>');
isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
function ddInit(e){
topDog=isIE ? "BODY" : "HTML";
whichDog=isIE ? document.all.message2 : document.getElementById("message2");
hotDog=isIE ? event.srcElement : e.target;
while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;}
if (hotDog.id=="titleBar"){
offsetx=isIE ? event.clientX : e.clientX;
offsety=isIE ? event.clientY : e.clientY;
nowX=parseInt(whichDog.style.left);
nowY=parseInt(whichDog.style.top);
ddEnabled=true;
document.onmousemove=dd;}}
function dd(e){
if (!ddEnabled) return;
whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx+'px';
whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety+'px';
return false;}
function ddN4(whatDog){
if (!isN4) return;
N4=eval(whatDog);
N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
N4.onmousedown=function(e){
N4.captureEvents(Event.MOUSEMOVE);
N4x=e.x;
N4y=e.y;}
N4.onmousemove=function(e){
if (isHot){
N4.moveBy(e.x-N4x,e.y-N4y);
return false;}}
N4.onmouseup=function(){
N4.releaseEvents(Event.MOUSEMOVE);}}
function hideMe(){
if (isIE||isNN) whichDog.style.visibility="hidden";
else if (isN4) document.message2.visibility="hide";}
function showMe(){
if (isIE||isNN) whichDog.style.visibility="visible";
else if (isN4) document.message2.visibility="show";}
function fll()
{
document.body.onmousedown=ddInit;
}
document.onmouseup=Function("ddEnabled=false");
function keyDown(e, trace){
if (trace=="home"){
var n=(window.Event) ? e.which : e.keyCode;
if(n==9 && document.getElementById('message2').className=="don"){return false;}else if(n==32 && document.getElementById('message2').className=="don"){return false;}
else if(n==27 && document.getElementById('message2').className=="don"){blowup_off_js();}}
else{
var n=(window.Event) ? e.which : e.keyCode;
if(n==9 && p_blo.className=="don"){return false;}else if(n==32 && p_blo.className=="don"){return false;}else if(n==27 && p_blo.className=="don"){blowup_hide();}if((n==37 && p_blo.className=="don") || (n==38 && p_blo.className=="don")){if (imgid==1){return false;}previousimg();}else if((n==39 && p_blo.className=="don") || (n==40 && p_blo.className=="don")){if (imgid==dataref.length){return false;}nextimg();return false;}}}
//dynamiclayout effect start
var myWidthnew ="";
// dynamicLayout
function dynamicLayout(){
if( typeof( window.innerWidth ) == 'number' ) {
myWidthnew = window.innerWidth;

} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    myWidthnew = document.documentElement.clientWidth;

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
   myWidthnew = document.body.clientWidth;
  }

if (document.getElementById('container1'))
{
if (myWidthnew > 1280)
{
document.getElementById('container1').style.width = "1280px";
document.getElementsByTagName('body')[0].className = "bg"; //this line for body bg
}
else
{
document.getElementById('container1').style.width = "";
document.getElementsByTagName('body')[0].className = "bg"; //for body body bg
}
}
}
dynamicLayout();

function addEvent( obj, type, fn ){
   if (obj.addEventListener){
	  obj.addEventListener( type, fn, false );
   }
   else if (obj.attachEvent){
	  obj["e"+type+fn] = fn;
	  obj[type+fn] = function(){ obj["e"+type+fn]( window.event ); }
	  obj.attachEvent( "on"+type, obj[type+fn] );
   }
}
addEvent(window, 'load', dynamicLayout);
addEvent(window, 'resize', dynamicLayout);
//dynamiclayout effect end
/* hot offers */
function hotoffer()
{
document.getElementById('hotproductsbox').className="newon";
document.getElementById('launchbox').className="newoff";
document.getElementById('h').className="ho txc c12 b";
document.getElementById('l').className="nl txc c13 b cu";
document.getElementById('foroffer').style.display="block";
document.getElementById('forlaunch').style.display="none";
}
function newlaunch()
{
document.getElementById('hotproductsbox').className="newoff";
document.getElementById('launchbox').className="newon";
document.getElementById('h').className="n2 txc c13 b cu";
document.getElementById('l').className="ho1 txc c12 b";
document.getElementById('foroffer').style.display="none";
document.getElementById('forlaunch').style.display="block";
}
