function RunFlashSx()
{
   document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="523" height="256">\n');
   document.write('<param name="loop" value="false" />\n');
   document.write('<param name="movie" value="../CarService.swf">\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<embed src="../CarService.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"  width="523" height="256"></embed>\n');
   document.write('</object>\n');
}
function RunFlashDx()
{
   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="780" height="220">\n');
   document.write('<param name="loop" value="false" />\n');
   document.write('<param name="movie" value="immagini/bambina.swf">\n');
   document.write('<param name="quality" value="high" />\n');
   document.write('<embed src="immagini/bambina.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="780" height="220"></embed>\n');
   document.write('</object>\n');
}

function RenderFlash( width, height, flashsrc, imagesrc, bgcolor )
{

MM_FlashCanPlay = 0;
MM_contentVersion = 5;

var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
   	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

if ( MM_FlashCanPlay ) {
	document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
	document.write('codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
	document.write('ID="scr"' + '"ipt" height="' + height + '" width="' + width + '">');
	document.write('<PARAM NAME="allowScriptAccess" VALUE="sameDomain">');
	document.write('<PARAM NAME="Movie" VALUE="' + flashsrc + '">');
	document.write('<PARAM NAME="Src" VALUE="' + flashsrc + '">');
	document.write('<PARAM NAME="Quality" VALUE="High">');
	document.write('<PARAM NAME="BGColor" VALUE="' + bgcolor + '">');
	/*document.write('<PARAM NAME="wmode" value="opaque"> ');*/
	document.write('<EMBED src="' + flashsrc +  '"');
	document.write('loop=true quality=high bgcolor="' + bgcolor + '"  WIDTH=' + width + ' height=' + height + ' ');
	document.write('TYPE="application/x-shockwave-flash" ');
	document.write('PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
	 document.write('</EMBED>'); 
	document.write('</OBJECT>');
	
	
		  
} else{
		document.write('<img alt="flash not detected" src="' + imagesrc + '" border=0>');
}
}
function cycleAds()
{
    if (document.images)
    {
        if (document.adBanner.complete)
        {
            if (++thisAd == adImages.length)
                thisAd = 0;

            document.adBanner.src = adImages[thisAd];
        }
    }

    // change to next sponsor every 3 seconds
    setTimeout("cycleAds()", 3000);
}

function gotoAd()
{
    document.location.href = "http://" + adURLs[thisAd];
}

function screenResolution(){
	now=new Date;
	bumber=now.getDay();
	x= bumber - 1;
	img = ["01.jpg", "02.jpg", "03.jpg","04.jpg", "05.jpg", "06.jpg", "07.jpg"]
	/*var img = "01.jpg";*/
	var screenResolution;
	screenResolution = screen.width;
	if (screenResolution > 800){
		document.write(now);
		document.write("_________________________________________________________");
		document.write(bumber);
		document.write('<img src="/images/banner/' + img[x] + '" alt="banner" width="200" height="350">');
	}
}

function RenderScreen()
							{
								var screenWidth = screen.width;
								var boolean = "NO"
								if ( screenWidth = 1024 ) {
									var boolean = "YES";
									return boolean;
								}
							}


function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}


function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2) 
  {alert(alerttxt);return false}
else {return true}
}
}


function validate_form(thisform)
{
with (thisform)
{
	if (validate_required(Nome,"Not a valid Name!")==false)
	  {field.focus();return false}
	}
	if (validate_required(Cognome,"Not a valid Surname!")==false)
	  {field.focus();return false}
	}
	if (validate_required(Telefono,"Not a valid phone number!")==false)
	  {field.focus();return false}
	}

}

function PrintPage()
{
	setTimeout("window.print()",100)
}

function RunSlideShow(id){
	if( document.SlideShowArray[id] )
	{
		if( document.SlideShowArray[id].preLoad[document.SlideShowArray[id].j].complete )
		{
			if (document.all){
				document.SlideShowArray[id].object.style.filter="blendTrans(duration=" + document.SlideShowArray[id].crossFadeDuration + ")"
				document.SlideShowArray[id].object.filters.blendTrans.Apply()      
			}
			document.SlideShowArray[id].object.src = document.SlideShowArray[id].preLoad[document.SlideShowArray[id].j].src
			if (document.all){
				document.SlideShowArray[id].object.filters.blendTrans.Play()
			}
			document.SlideShowArray[id].j = document.SlideShowArray[id].j + 1
			if (document.SlideShowArray[id].j > (document.SlideShowArray[id].p-1)) document.SlideShowArray[id].j=0
		}
		setTimeout('RunSlideShow(\"' + id + '\")', document.SlideShowArray[id].slideShowSpeed)
	}
}

function SlideShowObject(imgObject, arguments)
{
	this.object = imgObject
	this.slideShowSpeed = arguments[1]
	this.crossFadeDuration = arguments[2]
	this.Pic = new Array()
	
	for (i=3; i < (arguments.length); i++) {
		this.Pic[i-3] = arguments[i]
	}
	
	this.j = 0
	this.p = this.Pic.length
	
	this.preLoad = new Array()
	for (i = 0; i < this.p; i++){
	   this.preLoad[i] = new Image()
	   this.preLoad[i].src = this.Pic[i]
	}
}

// Params: imgObject, slideShowSpeed, crossFadeDuration, slideShowImages
// eg: <img src="slideshow1.jpg" onload="CreateSlideShow(this,4000,2,'slideshow2.jpg','slideshow3.jpg','slideshow1.jpg')">
function CreateSlideShow(imgObject, slideShowSpeed, crossFadeDuration)
{
	if( !document.SlideShowArray ) document.SlideShowArray = new Array()
	if( !document.SlideShowCounter ) document.SlideShowCounter = 0;
	
	if( imgObject.name == "" )
	{
		imgObject.name = "slide" + document.SlideShowCounter++;
	}
	
	if( document.SlideShowArray[imgObject.name] == null)
	{
		document.SlideShowArray[imgObject.name] = new SlideShowObject(imgObject, CreateSlideShow.arguments)
		setTimeout('RunSlideShow(\"' + imgObject.name + '\")', ( slideShowSpeed > (crossFadeDuration*1000) ? slideShowSpeed - (crossFadeDuration*1000) : 0))
	}
}
