browserName = navigator.appName;
browserVer = navigator.appVersion.substring(0,1);

if (browserName != "Netscape") {
	foo = navigator.appVersion.split(';');
	foo = foo[1].split(' ');
	browserVer = foo[2];
}

orginalDocumentWidth = document.width;
orginalDocumentHeight = document.height;

function scrollbarVisibility (visibility) {
	if (browserName == "Netscape" && browserVer > 3 ) {
		if (visibility) {
			document.width=orginalDocumentWidth;
			document.height=orginalDocumentHeight;
		} else {
			document.width=window.innerWidth;
			document.height=window.innerHeight;
		}
	}
	if (browserName != "Netscape" && browserVer > 3) {
		if (!visibility) {
			document.body.scroll="no";
		} else {
			document.body.scroll="yes";
		}
	}
}

function flashDetectHTML(flashHTML,noFlashHTML,required_version) {
	if ( browserName == "Netscape" ) {
		if ( navigator.plugins['Shockwave Flash'] ) {
			tmp = navigator.plugins['Shockwave Flash'].description;
			tmp = tmp.split(' ');
			flashversion = tmp[2].split('.');
			flashversion = flashversion[0];
			if (flashversion < required_version ) {
				document.writeln(noFlashHTML);
			}

			if (flashversion >= required_version ) {
				document.writeln(flashHTML);
			}
		}
		if (!navigator.plugins['Shockwave Flash'] ) {
			document.writeln(noFlashHTML);
		}
	} else {
		if ( navigator.userAgent.indexOf('Win') != -1) {
			var endtag='</';
			document.writeln('<script language=VBscript> ');
			document.writeln('Function Detect() ');
			document.writeln('	on error resume next ');
			document.writeln('	If ScriptEngineMajorVersion >= ' + required_version + ' then ');
			document.writeln('		 Detect = False ');
			document.writeln('		 Detect = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash")) ');
			document.writeln('		 If (err) then	');
			document.writeln('				Detect = False ');
			document.writeln('		 End If ');
			document.writeln('	 Else ');
			document.writeln('		Detect = False ');
			document.writeln('	 End If ');
			document.writeln('End Function ');
			document.writeln(endtag+'script >');
			if (!Detect() ) {
				if(browserVer < 5) {
					document.writeln(flashHTML);
				} else { document.writeln(noFlashHTML); }
			} else {
				document.writeln(flashHTML);
			}
		} else {
			document.writeln(flashHTML);
		}
	}
}

function popup(url,width,height) {
	win=window.open(url,'','toolbar=no,scrollbars=auto,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height+',left=100,top=100,titlebar=no')
}

function popwith(url,width,height) {
	win=window.open(url,'','toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=no,width='+width+',height='+height+',left=100,top=100,titlebar=no')
}

function otworz(url,width,height) {
	popup(url,width,height);
}

function validate() {
				if (document.form3.select10.options[document.form3.select10.options.selectedIndex].value=='none') {
								alert('Wybierz model telefonu');
								return false;
				}
				else if (document.form3.select11.options[document.form3.select11.options.selectedIndex].value=='none')
				 {
								alert('Wybierz miasto');
								return false;
				}
				else return true;
}

function send2friend() {
	win=window.open("http://partner.nokia.com.pl/cgi-bin/send2friend/send2friend?action=0&loc="+document.location.href,"send2friend", "height=320,width=500,left=45,top=45");
}

function goURL() {
	var df = document.forms[0];
	if(df.sel.options[df.sel.selectedIndex].value != -1);
		document.location.href=df.sel.options[df.sel.selectedIndex].value;
}

function zamow() {
	nwnd = window.open("form_promocja_gwiazdka.html", "zamow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=500,height=520");
}

function zamow_new() {
	nwnd = window.open("form_promocja_gwiazdka_new.html", "zamow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=485,height=665,left=345,top=45");
}

function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;
	window.top.location.href = gourl;
}

window.onError = null;


function windowOpener(url,width,height,name,scrolls) {
	browserName = navigator.appName;
	browserVer = navigator.appVersion.substring(0,1);
	if (width==null) {width=600;}
	if (height==null) {height=400;}
	if (name==null) {name="globaltPopup"}
	if (scrolls==true) {
		scrollsOption="yes";
	} else {
		scrollsOption="no";
	}
	var topPx = (browserName=="Netscape")?"screenX":"top";
	var leftPx = (browserName=="Netscape")?"screenY":"left";
	if (browserName != "Netscape" || browserVer != 2) {
		controlWindow=window.open(
		url,name,"toolbar=no,height="+height+",width="+width+",location=no,directories=no,status=no,menubar=no,scrollbars="+scrollsOption+",resizable=no,"+leftPx+"=60,"+topPx+"=70"
		);
	}
}

