/* This code is for varyfiying if a cookie exists or not */

/* Begins here */





function getCookie(cookieName,name)

{

var cookieValue = document.cookie;

var cookieStartsAt = cookieValue.indexOf(" " + cookieName + "=");

var pageName = name;

	if (cookieStartsAt == -1)

	{

	cookieStartsAt = cookieValue.indexOf(cookieName + "=");

	}

	

	if (cookieStartsAt == -1 )

	{

		cookievalue = null;

	}

	else

	{

	cookieStartsAt = cookieValue.indexOf("=",cookieStartsAt)+1;

	var cookieEndsAt = cookieValue.indexOf(";", cookieStartsAt);

	if(cookieEndsAt == -1)

		{

 		cookieEndsAt = cookieValue.length;

 		}

 		cookieValue = unescape(cookieValue.substring(cookieStartsAt,cookieEndsAt));

	}

	

 

 /* for every "else" statement blow just change the URL of login page....  */





 if ( pageName == "Downloads" )

 {

 	if ( cookieValue == "clear" )

	/* If a cookie exists, the page will go to this URL */		

 		location.href = "http://dp.pdf.com/site/docs/patches/downloads_agree.html";

 	else

	/* If a cookie does not exist, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/support/downloads_support.html";

 	}

 	 

 if ( pageName == "Online Support" )

 {

 	if ( cookieValue == "clear" )

	/* If a cookie exists, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/docs/idsdocs/onlinesupport.html";

 	else

	/* If a cookie does not exist, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/support/support.html";



 }

 	 

 if ( pageName == "Software Issues" )

 {

 	if ( cookieValue == "clear" )

	/* If a cookie exists, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/docs/bug_report/software_issues.html";

 	else

	/* If a cookie does not exist, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/support/software_issues.html";

 }

 			 

 if ( pageName == "Documentation" )

 {

 	if ( cookieValue == "clear" )

	/* If a cookie exists, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/docs/idsdocs/documentation.html";

 	else

	/* If a cookie does not exist, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/support/documentation_support.html";

 }



if ( pageName == "Services" )

 {

 	if ( cookieValue == "clear" )

	/* If a cookie exists, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/docs/services/services.html";

 	else

	/* If a cookie does not exist, the page will go to this URL */

 		location.href = "http://dp.pdf.com/site/support/services_support.html";

 } 			



} 



/* Ends here */
