conta1 = ""
conta2 = ""
conta3 = ""
conta4 = ""
conta5 = ""
conta6 = ""
conta7 = ""
mappa = 0
myFPosition = 0

$(document).ready(function(){
	$('.centralBodyContent .youtubelink').click(function(){
		mylink = this.href
		myFinalLink = mylink
		if(mylink.indexOf("?") > -1){
			myFinalLink = "http://www.youtube.com/v/"
			params = mylink.split("?")[1]
			splitChar = "&amp;"
			if(params.indexOf(splitChar) < 0) splitChar = "&"
			arrAnd = params.split(splitChar)
			for(i=0;i<arrAnd.length;i++){
				tempArr = arrAnd[i].split("=")
				variabile = tempArr[0]
				valore = tempArr[1]
				if(variabile.toLowerCase() == "v"){
					myFinalLink += valore + "?1=1"
				}
			}
		}else{
			myFinalLink += "?1=1"
		}
		self.parent.tb_show((this.title || this.name || null),myFinalLink+"&KeepThis=true&TB_iframe=true&height=510&width=640",(this.rel || false), window);
		return false;
	});
});

function youTubeThickbox(myLink){
	alert(1)
}

function showSolution(quale) {
    myImg = document.getElementById("myPixelHeight")
    switch (quale) {
        case 1:
            myImg.style.height = "60"
            break;
        case 2:
            myImg.style.height = "90"
            break;
        case 3:
            myImg.style.height = "124"
            break;
    }
    myImg.style.display = "block"
    myImg.style.borderBottom = "1px solid #EEE"
    document.getElementById("solRightCol").style.borderLeft = "1px solid #EEE"
    document.getElementById("lyrSol"+quale).style.display = "block"
    document.getElementById("rett" + quale).style.display = "block"
}

function hideSolution(quale) {
    myImg = document.getElementById("myPixelHeight")
    myImg.style.display = "none"
    myImg.style.borderborderBottom = "none"
    document.getElementById("solRightCol").style.borderLeft = "none"
    document.getElementById("lyrSol" + quale).style.display = "none"
    document.getElementById("rett"+quale).style.display="none"
}

function CKLogin(pathFile) {
    openTickbox("inputData.asp?pathFile=" + pathFile, "700", "400", 0)
}

function closeFromPopup() {
    closeTickBox();
    parent.clearTimeout(parent.myFPosition)
}

function showFCKEditor(id, idLingua, myData, showData) {
    MF = document.postFCKText
    MF.myData.value = myData
    MF.showData.value = showData

    myTextLyr = document.getElementById("myDetText")
    myWholeText = myTextLyr.innerHTML
    myIndex = myWholeText.indexOf("<!--START-->")
    myIndex += "<!--START-->".length

    myDateToHide = myWholeText.substring(0, myIndex)
    MF.strData.value = myDateToHide

    myTextLyr.style.display = "none"
    MF.style.display = "block"
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	caricato=true
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function colorabordo(quale){
	if(quale.style.border=="#000 1px solid"){
		quale.style.border="#AAA 1px solid"
	}else{
		quale.style.border="#000 1px solid"
	}
}


function controlla_1step(questo){
	var mio = document.getElementById("lyr_form")
	if(questo.checked){
		if(letto == false){
			alert(eval("step1_"+document.req.lingua))
		}
		mio.style.display="block"
		if(questo.dove=="popup"){
			parent.window.resizeTo(536,495)
		}
		if(questo.dove=="stampa"){
			parent.window.resizeTo(480,500)
		}
		parent.topzero.location="../carica.asp?caricaora=1"
	}else{
		mio.style.display="none"
		if(questo.dove=="popup"){
			parent.window.resizeTo(520,232)
		}
		if(questo.dove=="stampa"){
			parent.window.resizeTo(480,368)
		}
	}
}


function controlla_2step(questo){
	if(questo.value=="si"){
		if(letto2 == false){
			//alert("Prima di procedere con la compilazione del modulo, vi consigliamo di leggere\nla nota informativa sul trattamento e l'invio dei dati personali")
			alert(eval("step2_"+document.req.lingua))
		}
		parent.topzero.location="../carica.asp?caricaora=3"
	}
}

function copiamail(questo){
	document.req.mlist.value=questo.value
}

function clearMenu(myMenuItem, myMenuItem2){
	var subMenuItems = parent.myFrame.document.getElementsByName(''+ myMenuItem +'');
	var subMenuItems2 = parent.myFrame.document.getElementsByName(''+ myMenuItem2 +'');
	for (i = 0; i < subMenuItems.length; i++) {
        subMenuItems[i].style.fontWeight='normal';
    }
	for (j = 0; j < subMenuItems2.length; j++) {
        subMenuItems2[j].style.fontWeight='normal';
    }
}

function checkLeftMenu(menuId, myMenuItem) {
    var subMenuItems = document.getElementsByName(''+ myMenuItem +'');
    for (i = 0; i < subMenuItems.length; i++) {
        subMenuItems[i].style.fontWeight='normal';
    }
    subMenuItems[menuId].style.fontWeight='bold';
}

function checkLeftMenu2(menuId, myMenuItem){
	var menuLast = document.req.lastChecked.value;
	if (menuLast != null && menuLast != '')
	{
		var oldVar = document.getElementsByName(''+ menuLast +'')
		for (i = 0; i<oldVar.length;i++){
			oldVar[i].style.fontWeight='normal'
		}
	}
	//alert (menuLast)
	var newVar = document.getElementsByName(''+ myMenuItem +'')

	for (i = 0; i<newVar.length;i++){
		newVar[i].style.fontWeight='normal'
	}
	newVar[menuId].style.fontWeight='bold'
	
	if (document.req.lastChecked.value != null
		&& document.req.lastChecked.value != '')
		{
		document.req.lastChecked.value = myMenuItem;
		}
		
}

function checkTopMenu(menuId, myMenuItem){
	var newVar = document.getElementsByName(''+ myMenuItem +'')
	for (i = 0; i<newVar.length;i++){
		newVar[i].className='top_menu' 
	}
	newVar[menuId].className='top_menu_on'
}

function checkBottomMenu(menuId, myMenuItem){
	var newVar = document.getElementsByName(''+ myMenuItem +'')
	for (i = 0; i<newVar.length;i++){
		newVar[i].className='bottom_menu' 
	}
	newVar[menuId].className='bottom_menu_on'
}

function resizeFrame(myFrame, myDiv){
	//alert (myFrame)
	//alert (myDiv)
	var myObj = parent.document.getElementById(''+ myFrame +'')
	//alert (myObj)
	if(myObj){
	   myObj.style.height = document.getElementById(''+ myDiv +'').offsetHeight
	}
	//alert (myObj.style.height)
}

function setLanguage(quale){
	myForm = document.formLanguage
	if(myForm){
		myField = myForm.langWebSite
		if(myField){
			myField.value = quale
			myForm.submit()
		}
	}
}

function checkSearch(messaggio){
	myForm = document.searchForm
	if(myForm){
		myField = myForm.searchField
		if(myField){
			quale = myField.value
			if(quale.length < 3){
				alert(messaggio)
				myField.focus()
				return false;
			}
			myForm.submit()
		}
	}
}

function impostaLogoDefault(questo){
	questo.src = "../staff/images/logo.gif"
}

function SH_Coming(myStatusComing,myTopComing){
	var myLyrComing = document.getElementById("lyrComing")
	if(myLyrComing){
		if(myTopComing!=""){
			myLyrComing.style.top = myTopComing
		}else{
			myLyrComing.style.top = "50%"
		}
		myLyrComing.style.display=myStatusComing
	}
}

function cambiapagina(operation,messerrore){
	var myForm = eval("document.formPaging")
	switch(operation){
		case "back":
			myForm.numPage.value--
		break    
		case "next":
			myForm.numPage.value++
		break
		case "ricerca":
			if(myForm.page_field.value==0 || isNaN(myForm.page_field.value)){
				alert(messerrore)
				myForm.page_field.focus()
				return false;
			}
			myForm.numPage.value = myForm.page_field.value
		break
		default:
			if(operation!=""){
				myForm.numPage.value = operation
			}else{
				return false;
			}
	}
	myForm.submit()
}

function cambiapaginaCatalogue(operation,messerrore){
	var myFormPaging = eval("document.formPaging")
	var myForm = eval("document.searchProducts")
	switch(operation){
		case "back":
			myForm.numPage.value--
		break    
		case "next":
			myForm.numPage.value++
		break
		case "ricerca":
			if(myFormPaging.page_field.value==0 || isNaN(myFormPaging.page_field.value)){
				alert(messerrore)
				myFormPaging.page_field.focus()
				return false;
			}
			myForm.numPage.value = myFormPaging.page_field.value
		break
		default:
			if(operation!=""){
				myForm.numPage.value = operation
			}else{
				return false;
			}
	}
	myForm.submit()
}

var myScrollPageTimeout
var going = 0
function scrollaPaging(come){
	if(going == 1){
		var myObj = document.getElementById("scrollPaging")
		if(come=="next"){
			var myObjInsideWidth = document.getElementById("scrollPagingIn").offsetWidth-3
			if(myObj.scrollLeft < myObjInsideWidth){
				myObj.scrollLeft = myObj.scrollLeft + 3
				myScrollPageTimeout = setTimeout("scrollaPaging('"+come+"')",1)
			}else{
				myObj.scrollLeft = myObjInsideWidth -3
				clearTimeout(myScrollPageTimeout)
			}
		}else{
			if(myObj.scrollLeft > 3){
				myObj.scrollLeft = myObj.scrollLeft - 3
				myScrollPageTimeout = setTimeout("scrollaPaging('"+come+"')",1)
			}else{
				myObj.scrollLeft = 0
				clearTimeout(myScrollPageTimeout)
			}
		}
	}
}

function SHAltSim(quale){
	myObjAlt = document.getElementById("lyrPhoto_"+quale)
	if(myObjAlt){
		if(myObjAlt.style.display=="" || myObjAlt.style.display=="none"){
			myObjAlt.style.display="block"
		}else{
			myObjAlt.style.display="none"
		}
	}
}

function stopScrollaPaging(){
	clearTimeout(myScrollPageTimeout)
	going = 0
}

function caricaDefault(questo){
	questo.src="../images/1pixel.gif"
	questo.style.background = "url(../images/imgdefault.jpg)"
	questo.style.backgroundPosition = "center center"
	questo.style.backgroundRepeat = "no-repeat"
}

function zoomImmagini(pagina,titolo,varLink_2,varTipoOggetto_2,varTipoLink_2,varImg_2,varTesto_2,myActualId){
	myObjVar = eval(myActualId)
	myVar = ""
	if(myObjVar) myVar = myObjVar
	window.open(pagina+'?titolo='+titolo+'&varLink_2='+varLink_2+'&varTipoOggetto_2='+varTipoOggetto_2+'&varTipoLink_2='+varTipoLink_2+'&varImg_2='+varImg_2+'&varTesto_2='+varTesto_2+'&myActualId='+myVar,'zoom','scrollbars=yes,resizable=yes,width=800,height=600')
}

function ricercaNews(testoTitAlmeno,testoTitVuoto,testoSelAzienda,testoSelTipo){
	var myForm = document.searchNews
	if(myForm.newssearchField.value.length < 3){
		alert(testoTitAlmeno)
		myForm.newssearchField.focus()
		return false;
	}
	if(myForm.newssearchField.value == ""){
		alert(testoTitVuoto)
		myForm.newssearchField.focus()
		return false;
	}
	if(myForm.newssearchAzienda.selectedIndex==0){
		alert(testoSelAzienda)
		myForm.newssearchAzienda.focus()
		return false;
	}
	if(myForm.newssearchTipologia.selectedIndex==0){
		alert(testoSelTipo)
		myForm.newssearchTipologia.focus()
		return false;
	}
	myForm.nomeAziendaSearchNews.value = myForm.newssearchAzienda.options[myForm.newssearchAzienda.selectedIndex].text
	myForm.submit()
}

function cambiaPaginaDaLink(myStrTipoLink,myStrLink){
	myPrevAddress = ""+document.location
	myPrevAddress = myPrevAddress.replace("http://","")
	var myArrString = myPrevAddress.split("/")
	myAddress = ""
	for(i=0;i<myArrString.length-1;i++){
		myAddress = myAddress + myArrString[i] + "/"
	}
	if(myStrTipoLink==0){
		document.location = "http://"+myAddress+myStrLink
	}else{
		window.open(myStrLink,'','')
	}
}

function accendimenu(quale){
	var myObj = document.getElementsByName("top_menu")[quale]
	if(myObj) myObj.className = myObj.className+"_on"
}

function accendimenusotto(quale){
	var myObj = document.getElementsByName("bottom_menu")[quale]
	if(myObj) myObj.className = myObj.className+"_on"
}

function searchJob(myError){
	if(document.jobSearch.categoria.selectedIndex==0 && document.jobSearch.azienda.selectedIndex==0){
		alert(myError)
		document.jobSearch.categoria.focus()
		return false;
	}
	document.jobSearch.submit()
}

function cambiaNRP(questo,fieldToUpdate,secondField){
	var myValue = questo.options[questo.selectedIndex].value
	if(myValue!=""){
		document.getElementsByName("caricaNRP")[0].src="/caricaNRP.asp?id="+myValue+"&fieldToUpdate="+fieldToUpdate
	}else{
		var myObj = eval("document.req."+fieldToUpdate)
		for (i=myObj.options.length;i>=1;i--){
			myObj.options[i]=null
		}
		if(secondField!=""){
			var myObj = eval("document.req."+secondField)
			for (i=myObj.options.length;i>=1;i--){
				myObj.options[i]=null
			}
		}
	}
}

function mostraaltroconosciuti(questo){
	var myValue = questo.options[questo.selectedIndex].value
	myStatus = "none"
	if(myValue=="0"){
		myStatus = "block"
	}
	document.getElementById("lyraltroconosciuti").style.display=myStatus
	document.req.altroconosciuti.value=""
}

function controllaSettore(questo){
	var myValue = questo.options[questo.selectedIndex].value
	var myBackground = "#EEE"
	var myDisabled = true
	if(myValue==0){
		myBackground = "#FFF"
		myDisabled = false
	}
	document.req.sector_specify.style.background = myBackground
	document.req.sector_specify.disabled = myDisabled
	if(!document.req.sector_specify.disabled) document.req.sector_specify.focus()
}

function goToProd(quale){
	document.searchProducts.action = "catalogue_visua.asp"
	document.searchProducts.method = "get"
	document.searchProducts.id.value = quale
	document.searchProducts.submit()
}

function goBack(){
	if(document.searchProducts.length > 1){
		document.searchProducts[1].submit()
	}else{
		document.searchProducts.submit()
	}
}

function addToYourCat(whichOne,operazione,message){
	proceed = "ok"
	opType = ""
	if(whichOne!=""){
		myFrame = document.getElementById("frameMyCatalogue")
		if(myFrame){
			if(!document.cookie){
				alert(message)
			}else{
				if(operazione=="togli"){
					if(window.confirm(message)){
						opType="&opType=togli"
					}else{
						proceed = "no"
					}
				}
				if(proceed == "ok") myFrame.src = "addToMyCatalogue.asp?id="+whichOne+opType
			}
		}
	}
}

function addToCompare(whichOne,whichCols,operazione,message){
	proceed = "ok"
	opType = ""
	if(whichOne!=""){
		myFrame = document.getElementById("frameMyCatalogue")
		if(myFrame){
			if(!document.cookie){
				alert(message)
			}else{
				if(operazione=="togli"){
					if(window.confirm(message)){
						opType="&opType=togli"
						document.getElementById("contentTable").rows[0].deleteCell(whichCols)
						
					}else{
						proceed = "no"
					}
				}
				if(proceed == "ok") myFrame.src = "addToCompare.asp?id="+whichOne+opType
			}
		}
	}
}

function openCompare(){
	try {
		window.open("compare.asp","compare","scrollbars=yes,resizable=yes,top=10,left=10,width="+(screen.width-30)+",height="+(screen.height-100)) // IE only
	}catch(ex){
		window.open("compare.asp","compare","scrollbars=yes,resizable=yes,top=10,left=10,width=800,height=500") // standards compliant; doesn't work in IE
	}
}

function selArts(whichOne,myStatus){
	document.getElementById("lyrCompare_"+whichOne).style.display=myStatus
	document.getElementById("myFrameCompare_"+whichOne).src = "compareArticles.asp?id="+whichOne
}

function confirmArticles(whichOne,operazione,message){
	builtAssociation = ""
	myObjForm = document.req.addArticle
	for(i=0;i<myObjForm.length;i++){
		if(myObjForm[i].checked){
			builtAssociation = builtAssociation + whichOne + "[code]" + myObjForm[i].value + ","
		}
	}
	if(builtAssociation!="") builtAssociation = builtAssociation.substring(0,(builtAssociation.length-1))
	myFrame = parent.document.getElementById("frameMyCatalogue")
	if(myFrame) myFrame.src = "addToCompare.asp?id="+builtAssociation
	myDivOut = parent.document.getElementById("lyrCompare_"+whichOne)
	if(myDivOut) myDivOut.style.display="none"
}

function SH_BenefitsCategory(whichCat){
	var myObj = document.getElementById("lyrCatBenefits_"+whichCat)
	if(myObj.style.display=="" || myObj.style.display=="none"){
		myObj.style.display="block"
	}else{
		myObj.style.display="none"
	}
}

function checkGlobalSearch(messaggio){
	myForm = document.searchForm
	if(myForm.searchField.value=="" || myForm.searchField.value.length<3){
		alert(messaggio)
		myForm.searchField.focus()
		return false;
	}
	myForm.submit()
}

function modTxtFromViewMode(quale,myLingua){
	parent.topFrame.location="../gestViewMode.asp?idTipoTesto="+quale+"&idLingua="+myLingua
	return false;
}

myIdGalleryT = 0
function loadGallery(tickPage){

		var fo = new SWFObject("/viewer.swf", "viewer", "100%", "100%", "8", "#000000");

		// SIMPLEVIEWER CONFIGURATION OPTIONS
		// To use an option, uncomment it by removing the "//" at the start of the line
		// For a description of config options, go to: 
		// http://www.airtightinteractive.com/simpleviewer/options.html
		myIdGalleryT = tickPage
		fo.addVariable("xmlDataPath", "/gallery.asp?id="+tickPage);

		//fo.addVariable("firstImageIndex", "5");	
		//fo.addVariable("langOpenImage", "Open Image in New Window");
		//fo.addVariable("langAbout", "About");	
		//fo.addVariable("preloaderColor", "0xFFFFFF");
		
		fo.write("flashRassegna");	
}

function attLbl(myObj,status1,status2){
	myObjs= document.getElementsByName("linklbl")
	for(i=0;i<myObjs.length;i++){
		myObjs[i].className = "lbllinks"
	}
	myObj.className = "lbllinksOn"
	document.getElementById("flashRassegna").style.display = status1
	document.getElementById("Panoramiche").style.display = status2
	if(status2 == "block") fPanoramiche.location = "panoramiche.asp?id="+myIdGalleryT
}

function restartGallery(){
	attLbl(document.getElementsByName('linklbl')[0],'block','none')
}


function setSubMenuHeight(thisOne) {
    myObj = document.getElementById('lyrMenu_' + thisOne)
    if(myObj) document.getElementById('lyrMenu_' + thisOne + '_1').style.height = document.getElementById('lyrMenu_' + thisOne + '_2').offsetHeight + 'px'
}

function openRss(myObj) {
    myObjs = document.getElementsByName("rssLinks")
    for (i = 0; i < myObjs.length; i++) {
        mId = myObjs[i].id.replace("myRSSLink_", "")
        myObjs[i].className = "rssLinks linkAll"
        myTempObj = document.getElementById("myRss_" + mId)
        if (myTempObj) myTempObj.style.display = "none"
        myTempObj = document.getElementById("outerFrame_" + mId)
        if (myTempObj) myTempObj.style.display = "block"
    }
    myObj.className = "rssLinksOn linkAll"
    mId = myObj.id.replace("myRSSLink_", "")
    myTempObj = document.getElementById("myRss_" + mId)
    if (myTempObj) {
        myTempObj.style.display = "block"
        myFrame = eval("iFrameRss_" + mId)
        myFrame.location = "/loadRSSWidget.asp?id=" + mId
    }
}

function openDealerLocator() {
    tb_show()
    MyLyrSearch = document.getElementById("lyrSearch")
    if (MyLyrSearch) MyLyrSearch.style.display = "none"
    MyLoad = document.getElementById("TB_load")
    if (MyLoad) MyLoad.style.display = "none"
    MyOverBox = document.getElementById("overBox")
    if (MyOverBox) {
        moveOverBoxToCenter()
        loadAMMap()
        MyOverBox.style.display = "block"
    }
    document.body.onscroll = moveOverBoxToCenter
}

function loadAMMap() {
    // <![CDATA[
    var so = new SWFObject("/ammap/ammap/ammap.swf", "ammap", "100%", "100%", "8", "transparent");
    so.addVariable("path", "/ammap/ammap/");
    so.addParam("wmode", "transparent");
    so.addVariable("data_file", escape("/ammap/ammap/ammap_data.xml"));
    so.addVariable("settings_file", escape("/ammap/ammap/ammap_settings.xml"));
    so.addVariable("preloader_color", "#CCCCCC");
    so.write("overBoxInside");
    // ]]>
}

function amRegisterClickAnywhere(map_id, object_id, title, value) {
    //document.getElementById("anywhere_id").value = object_id;
    //document.getElementById("anywhere_title").value = title;
    //document.getElementById("anywhere_value").value = value;
    if (!isNaN(object_id)) {
        MyContinent = title
    } else {
        if (title) {
            MyCountry = title
            ShowHideTxtSearch("block")
        }
    }
}

function ShowHideTxtSearch(MyDisplay) {
    MyObj = document.getElementById("lyrSearch")
    if (MyObj) {
        MyObj.style.display = MyDisplay
        if (MyDisplay == "block") {
            MyAddr = document.getElementById("txtIndirizzo")
            if (MyAddr) {
                MyAddr.focus()
                MyAddr.select()
            }
        }
    }
}


function moveOverBoxToCenter() {
    MyScrollTop = getScreenScroll()
    MyScreenHeight = getScreenHeight()
    MyOverBox = document.getElementById("overBox")
    MyOverBox.style.display = "block"
    MyOverBoxHeight = MyOverBox.offsetHeight
    MyOverBox.style.display = "none"

    MyTop = MyScrollTop + (MyScreenHeight / 2) - (MyOverBoxHeight / 2)
    MyOverBox.style.top = MyTop + "px"
}

function getScreenScroll() {
    var _x = 0;
    var _y = 0;
    var offsetX = 0;
    var offsetY = 0;

    //IE
    if (!window.pageYOffset) {
        //strict mode
        if (!(document.documentElement.scrollTop == 0)) {
            offsetY = document.documentElement.scrollTop;
            offsetX = document.documentElement.scrollLeft;
        }
        //quirks mode
        else {
            offsetY = document.body.scrollTop;
            offsetX = document.body.scrollLeft;
        }
    }
    //w3c
    else {
        offsetX = window.pageXOffset;
        offsetY = window.pageYOffset;
    }
    return offsetY
}

function getScreenHeight() {
    var w = 0;
    var h = 0;

    //IE
    if (!window.innerWidth) {
        //strict mode
        if (!(document.documentElement.clientWidth == 0)) {
            w = document.documentElement.clientWidth;
            h = document.documentElement.clientHeight;
        }
        //quirks mode
        else {
            w = document.body.clientWidth;
            h = document.body.clientHeight;
        }
    }
    //w3c
    else {
        w = window.innerWidth;
        h = window.innerHeight;
    }

    return h
}

function showGoogleMap(MySearch) {
    tb_remove()
    MyOverBox = document.getElementById("overBox")
    if (MyOverBox) MyOverBox.style.display = "none"

    openTBLocator(MySearch)
}
