﻿function searchCategoriesCust(){
    document.forms[0].action = "/ny/search.aspx";
    document.forms[0].method = "get";
    document.forms[0].submit();
}

function addToList(){
    var videoId = document.getElementById("VideoId");
    var ms = new MapServices();
    ms.AddVideoToYourList(videoId.value,2);
    
    var DivNumberUserVideos = document.getElementById("DivNumberUserVideos");
    var GoToUserList = document.getElementById("GoToUserList");
    GoToUserList.src = "/ny/images/download/view_list_fade.gif";
    DivNumberUserVideos.style.visibility='visible'; 
    var ImageUserVideos = document.getElementById("ImageUserVideos");
    //ImageUserVideos.style.height = "121px";
}

function download(){
    var videoUri = document.getElementById("VideoUri");
	document.location.href= videoUri.value;
}

function send2Friend(){
    document.forms[0].action="/ny/SendTo.aspx";
    document.forms[0].method="post";
    document.forms[0].submit();
}

//Download Page
function closeButtonUserVIdeoList(idClose){
    var ms = new MapServices();
    ms.DeleteVideoFromYourList(idClose,2);
    var objRow = document.getElementById(idClose);
    if(objRow){
        objRow.style.display = 'none';
    }
}

function playButtonUserVIdeoList(url){
    document.forms[0].action=url;
    document.forms[0].method="post";
    document.forms[0].submit();
}

function downloadIPodButtonUserVIdeoList(nameFile){
    /*document.forms[0].action=nameFile;
    document.forms[0].method="get";
    document.forms[0].submit();*/
    document.location.href= nameFile;
}

function downloadFullVersionButtonUserVIdeoList(nameFile){
    /*document.forms[0].action=nameFile;
    document.forms[0].method="get";
    document.forms[0].submit();*/
    document.location.href= nameFile;
}

function getLongitudeLatitudeByPostCode(postCode){
    var ms = new MapServices();
	return ms.ValidateAddress(postCode);
}


var latitudeTop = 40.81069108268215;
var longitudeTop = -74.1082763671875;
var latitudeBotton = 40.68584503000695;
var longitudeBotton = -73.91120910644531;

google_ad_client = "ca-pub-0883440095118157";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "5D5D5D";
google_color_bg = "000000";
google_color_link = "434343";
google_color_text = "C3C3C3";
google_color_url = "929292";
google_ui_features = "rc:0";




var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Macintosh",
			identity: "Macintosh"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();