



function include(file)   

{     

  var script  = document.createElement('script');   

  script.src  = file;   

  script.type = 'text/javascript';   

  script.defer = true;   

  

  document.getElementsByTagName('head').item(0).appendChild(script);     

}





function openDisposable()

{

	location.href="disposableSurgicalGloves.html";

}



function openReUsable()

{

	location.href="reUsableSurgicalGloves.html";

}



function openPolymer()

{

	location.href="polymerCoatedSurgicalGloves.html";

}


function openProductPage(url)

{

	location.href=url;
		
}


// This method is used to send request from browser page to the server page and

// again sends response back from server page to browser page



var req=null;



function Initialize()

{

    try

    {

        req=new ActiveXObject("Msxml2.XMLHTTP");

    }

    catch(e)

    {

        try

        {

            req=new ActiveXObject("Microsoft.XMLHTTP");

        }

        catch(oc)

        {

            req=null;

        }

    }



    if(!req && typeof XMLHttpRequest!="undefined")

    {

        req= new XMLHttpRequest();



    }

} 





function getDataFromAJAX(url)

{

	var msg = "";

    Initialize();

    if(req != null)

    {

        //req.onreadystatechange = Process;

        req.open("POST", url, false);

        req.send(null);

		var msg=req.responseText;

		//return msg;

    }

    return msg;

}



//--------------------------------------------------------------------

var chartWin=0;

function openFlowchart(URLStr)

{

  if(chartWin)

  {

    if(!chartWin.closed) chartWin.close();

  }

  chartWin= open(URLStr, 'chartWin', "screenX=0,screenY=0,left=0,top=0,alwaysRaised=true,resizable=no,toolbar=0,menubar=0,location=0,scrollbars=1,status=1,copyhistory=0,width=790 height=560");

  chartWin.focus();

}	



//--------------------------------------------------------------------

 function getTheEffect(id)
{
	var href_tag=document.getElementById(id);

	href_tag.className="crnt";
}

//--------------------------------------------------------------------



// google translate

function doTranslate(lang_pair) {

        if (((location.hostname == 'www.truskinglove.com')||(location.hostname == 'nispaara.com')) && lang_pair == 'en|en') return;

        else if(((location.hostname != 'www.truskinglove.com')||(location.hostname != 'nispaara.com')) && lang_pair == 'en|en') 

        {
        	//alert("one");

        	location.href = gfg('u');
        }

        else if(((location.hostname == 'www.truskinglove.com')||(location.hostname == 'nispaara.com')) && lang_pair != 'en|en') 

        {
     	   //alert("two");

     	   location.href = 'http://translate.google.com/translate_p?client=tmpg&hl=en&langpair=' + lang_pair + '&u=' + location.href;
        }

		else 

		{
			//alert("three");

			location.href = 'http://translate.google.com/translate_p?client=tmpg&hl=en&langpair=' + lang_pair + '&u=' + gfg('u');
		}

		

}

// get from get

function gfg(name) {

		//alert("name="+name);

        name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");

        var regexS = "[\\?&]"+name+"=([^&#]*)";

        var regex = new RegExp(regexS);

        var results = regex.exec(location.href);

        if(results == null) return '';

       // alert(results[1])

        return results[1];

}

function logOff(url)
{

  var flag=confirm("Are You sure,want to Log Out");

  if(flag)  {
  		
  		var response=getDataFromAJAX("../loginController.php?action=invalidateSession");
  		
  		//alert(response);
  		
  		document.forms[0].action=url;
		
		document.forms[0].submit();  
  }
  
}



//--------------------------------------------------------------------



