﻿// Fichier JScript Millesima
/*function initPage()
{
	NbProduct = getObject("inBasket");
	BasketDiv = getStyleObject("basketDiv");
}*/
		

function getStyleObject(objectId) {
	if (document.getElementById)
		return document.getElementById(objectId).style;
	else{
		if (document.layers) return document.layers[objectId];
		else{if (document.all) return document.all(objectId).style;}}}

function getObject(objectId) 
{		
		if (document.getElementById) return document.getElementById(objectId);
		else {
			if (document.layers) return document.layers[objectId];
			else{if (document.all) return document.all(objectId);}}
}
 function EnvoyerAmi(Url)
        {
	        document.getElementById('modalEnvoyerAmi').visibility='visible';
	        ShowModalEnvoiAmi();
        }

 function GotoSearch(sSearch)
{
	document.location.href = '~/recherche_vin.aspx?query=' + sSearch;
}
function GotoSearchKey(obj,e)
{
	var bEnter = false;
	
	if (document.all)
		{if (e.keyCode == 13) {e.returnValue = false; e.cancel = true; bEnter = true;}} 
	else if (document.getElementById)
		{if (e.which == 13) {e.returnValue = false; e.cancel = true; bEnter = true;}}
	else if (document.layers)
		{if (e.which == 13) {e.returnValue = false; e.cancel = true; bEnter = true;}}

	if (bEnter)
		document.location.href = '~/recherche_vin.aspx?query=' + obj.value;
}
function GotoSubscribe(sEmail)
{
	document.location.href = '~/InscriptionNL.aspx?email=' + sEmail;
}
function GotoSubscribeKey(obj,e)
{

	var bEnter = false;
	
	if (document.all)
		{if (e.keyCode == 13) {e.returnValue = false; e.cancel = true; bEnter = true;}} 
	else if (document.getElementById)
		{if (e.which == 13) {e.returnValue = false; e.cancel = true; bEnter = true;}}
	else if (document.layers)
		{if (e.which == 13) {e.returnValue = false; e.cancel = true; bEnter = true;}}

	if (bEnter)
		document.location.href = '~/InscriptionNL.aspx?email=' + obj.value;
}
function ValidateChamps()
{
    if (document.getElementById("nom").value == "" || document.getElementById("emailsrc").value  == "" || document.getElementById("emailAmi").value == "")
    {
        return false;
    }
    else
    {
        var strContenuMail = document.getElementById("contenuMail").innerText;
        if(strContenuMail.indexOf("\<%") > -1 || strContenuMail.indexOf("%>") > -1 || strContenuMail.indexOf("<asp:") > -1 || strContenuMail.indexOf("/>") > -1 )
            return false;
        else
            return true;
    }
}

function affiche_Popup(Path, title, scrollbar, width, height)
{
    var config = "menubar=no, status=no,scrollbars=";
    if (scrollbar == true)
        config = config + "yes";
    else
        config = config + "no";
    config = config + " , resizable= yes, width=" + width + ", height= " + height;
    window.open(Path,title,config);
}

function affiche_Popup1(Path, width, height)
{
    var scrollbar=false;
	//var width=800;
	//var height=600;
	var title = "Video";
	var config = "menubar=no, status=no,scrollbars=";
    if (scrollbar == true)
        config = config + "yes";
    else
        config = config + "no";
    config = config + " , resizable= yes, width=" + width + ", height= " + height;
    window.open(Path,title,config);
}


