function OpenShop(sURL) {
	window.open('http://www.puntocellulare.it'+sURL);
	//window.location='http://www.puntocellulare.it/offerte-cellulari/prezzi.html';
}

function printpage() {
window.print();  
}

if (self != top) {
   top.location = self.location;
}

var thisURL = document.URL;

function shareLink(strLinkName){
	var strURL = "";
	switch(strLinkName){
		case ("dig") :
			strURL = "http://digg.com/submit?phase=2&url="+thisURL;
			break;
		case ("del") :
			strURL = "http://del.icio.us/post?v=4&partner=sam&noui&jump=close&url="+thisURL;
			break;
		case ("facebook") :
			strURL = "http://www.facebook.com/share.php?u="+thisURL;
			break;
	}
	window.open(strURL,"");
}

function copyURL () { 
	window.clipboardData.setData('Text', thisURL); 
} 


// POPUP MANAGER

var win1='';
var win8='';
var MSIE = navigator.appName == "Microsoft Internet Explorer";
if(MSIE)
	var SP2 = (navigator.appMinorVersion.indexOf("SP2") != -1);
var FIREFOX = (navigator.userAgent.indexOf("Firefox") != -1);
var served=0;

function getcookie(cookiename) {
	var cookiestring=""+document.cookie;
	var index1=cookiestring.indexOf(cookiename);
	if (index1==-1 || cookiename=="") return ""; 
	var index2=cookiestring.indexOf(';',index1);
	if (index2==-1) index2=cookiestring.length; 
	return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}

function clickPop(id) {
	if (navigator.cookieEnabled) {
		if(!getcookie('clickcookie_'+id)) {	
			if ((SP2 && MSIE) || (FIREFOX)) {
				cookiestring='clickcookie_'+id+"="+1+";EXPIRES="+'';
				document.cookie=cookiestring;
				goPop();
			}
		}
	}
	return;
}

function arrange() {
	if(!win8.closed && win8.location) {
		win8.focus();
	}
	return;
}

function goPop() {
	if(served)
	{
		return;
	}
	else
	{
		var gourl='/_banner/pop_300x250.asp';
		if(!win1.closed && win1.location) {
			win8.location.href = gourl;
		}
		else {
			win8=window.open(gourl, "", " left=220,top=300,width=300,height=250,menubar=0,status=0,location=0,toolbar=0,scrollbars=0,titlebar=0,resizable=0");
		}
	}
	arrange();
	served=1;
	return;
}




var iframeids=["pb4"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

function sbox_on() {
 document.getElementById('sbox').className='searchbox_on';
}

function sbox_off() {
 document.getElementById('sbox').className='searchbox_off';
}

function sbox() {
document.write("<div class='searchbox_off' id='sbox'>");
document.write("<form method='post' action='/cgi-bin/cellulari_cerca.asp'>");
document.write("<b>Inserisci la sigla del cellulare da cercare:</b><br>");
document.write("<input type='text' name='searchSTR' class='form_txt1' size='26' maxlength='20'>&nbsp;&nbsp;<input type='submit' name='submit' value='CERCA' class='form_bt1'><br>");
document.write("<input type='radio' name='ricerca' value=Vscheda' checked>SCHEDA");
document.write("<input type='radio' name='ricerca' value='offerte'>OFFERTE");
document.write("<input type='radio' name='ricerca' value='notizie'>NOTIZIE");
document.write("</form><br>");
document.write("<form action='/cgi-bin/cerca.asp' id='cse-search-box'>");
document.write("<b>Cerca fra le pagine di PuntoCellulare.it:</b><br>");
document.write("<input type='hidden' name='cx' value='partner-pub-6040963297168986:x5ncnfo0ba1'>");
document.write("<input type='hidden' name='cof' value='FORID:11'>");
document.write("<input type='hidden' name='ie' value='ISO-8859-1'>");
document.write("<input type='text' name='q' size='25' class='form_txt1'>");
document.write(" <input type='submit' name='sa' value='CERCA' class='form_bt1'><br>");
document.write("</form><br>");
document.write("<input type='submit' value='ANNULLA' class='form_bt1' onClick='sbox_off(); return false'>");
document.write("</div>");
}