var loc=new String(self.location);





function CheckReferrer()

{

 return (document.referrer.indexOf(document.location.hostname) != -1);

}



function CheckPath()

{

 return (document.location.pathname.indexOf('/nw') != -1);

}



function CheckSearch()

{

 var querystr = document.location.search.substr(1);

 var queriestr = querystr.split('&');

 var queries = Array();

 for(var query in queriestr)

	{

	 var item = queriestr[query].split('=',2);

	 if(item.length == 2 && item[0] == 'nw')

		{

		 if(item[1] == 'true' || item[1] == '1')

			{

			 return true;

			}

		 else

			{

			 return false;

			}

		}

	}

 return false;

}



if(!CheckReferrer() && !CheckPath() && !CheckSearch())

	{

	 if (!confirm("                         WARNING - PORN WEBSITE !\n                   THIS WEBSITE IS RESERVED FOR ADULTS ONLY.\n \n\nIf you are not an adult, click Cancel ! \n \nIf you are an adult, click OK to continue !\n\nProtecting minors is essential to us, so please consult the following different websites \nwhich will help you to protect your children from adult based contents :\n  \n http://www.icra.org/ \n http://www.cyberpatrol.com/ \n http://www.cybersitter.com/ \n http://www.netnanny.com/ \n http://www.surfsafely.com/ \n \n This website is ICRA registered."))

		{

		 document.location.href="http://www.yahoo.com";

		} else {
		  // redirect the warning to now warning page
		  myString = new String(document.location)
      rExp = /nw=0/gi;
      rExp1 = /nw=false/gi;
      newString = new String ("nw=1");
      results = myString.replace(rExp, newString);
      results = results.replace(rExp1, newString);
      if (results.indexOf('nw=1') == -1){
        var querystr = document.location.search;
        if(querystr.length != 0){
           results = results+"&nw=1";
        } else {
           results = results+"?nw=1";
        }
      }
      document.location.href=results;
		}

	}


