﻿$(document).ready(function()
{
	//if cookies exists show it or ask for permission
	if (readCookie("newDefaultURL") == null) //Read the defaultURL
     {     	
		if (CheckUrl())
		{
          $('#cookies').show();
        }
        else
        {
        	HideCookiePopup();
        }
     }
});

function CallServerMsg(allow)
{     
	$('#cookies').html("<div style='text-align:center;'><img style='width:25px;' src='/PublishingImages/loading.gif' alt='Loading' /></div>");
	
     CallServer(allow,'');
}

function ReceiveServerData(arg, context)
{
	HideCookiePopup();
}
function HideCookiePopup()
{
    $('#cookies').hide();

}
function CheckUrl()
{
	var url= document.URL;
	var splitUrl = url.split("/");

	var urlEnd = splitUrl[splitUrl.length-2] + "/"+ splitUrl[splitUrl.length-1];
	if (urlEnd == "diy/default.aspx" || urlEnd == "pro/default.aspx")
	{
		return true;
	}
	else
	{
		return false;
	}
	
}

           
