function Myconfirm(Str,Url)
{
if (confirm(Str))
{
document.location = Url;
}
}
function register_form()
{
document.getElementById("register_form").style.display = "block";
}
/*
function Gfx(pic,x,y)
{
var s='
Perfect Englisht\n';
s=s+'\n';
s=s+'
\n';
s=s+'';
var f = null;
f = window.open('','','width='+x+',height='+y+',left=50,top=20,resizable=1,directories=0,location=0,menubar=0,scrollbars=0,status=0,toolbar=0');
if(f != null) {
if(f.opener == null) {
f.opener = self
}
f.document.clear();
f.document.write(s);
f.document.close();
}
}*/
function Gfx(pic,x,y)
{
var s='Perfect Englisht\n';
s=s+'\nŁadowanie...
';
s=s+'
\n
';
s=s+'';
var f = null;
f = window.open('','','width='+x+',height='+y+',left=50,top=20,resizable=1,directories=0,location=0,menubar=0,scrollbars=0,status=0,toolbar=0');
if(f != null) {
if(f.opener == null) {
f.opener = self
}
f.document.clear();
f.document.write(s);
f.document.close();
}
}
function image_js(sciezka,i)
{
image=document.getElementById('zdj'+i);
image.src='data/announce/image/min_'+sciezka;
}
function zoom(link,i)
{
image=document.getElementById('zdj'+i);
link = image.src.split("min_");
link1 = link[0];
if(typeof(link[1])!="undefined")
link1 += link[1];
link_old = image.src;
image.src = link1;
var newImg = new Image();
newImg.src = image.src;
var height = newImg.height;
var width = newImg.width;
var wind = window.open ("", "", "menubar=no,toolbar=no,location=no,directories=no,status=no,resizable=yes,scrollbars=yes,width="+width+",height="+height+", top=0, left=0");
//window.open('map.php?id='+id+'','','width=435,height=500,left=50,top=20,resizable=1,directories=0,location=0,menubar=0,scrollbars=1,status=0,toolbar=0');
wind.document.open();
if (!wind) alert("error");
wind.document.write("\n\n\tDestock"+
"\n\n\n\n"+
"\n\n
"+
"\n");
wind.document.close();
wind.focus();
//document.getElementById('zdj'+i) = link_old;
}
/***********************************************
* Bookmark site script- � Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
/* Modified to support Opera */
function bookmarksite(title,url)
{
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print)
{ // opera
var elem = document.createElement('a');
elem.setAttribute('href',url);
elem.setAttribute('title',title);
elem.setAttribute('rel','sidebar');
elem.click();
}
else if(document.all)// ie
window.external.AddFavorite(url, title);
}
function ativaOptionsDisabled(){
var span2 = document.getElementById("new")
var sels = span2.getElementsByTagName('select');
for(var i=0; i < sels.length; i++){
sels[i].onchange= function(){ //pra se mudar pro desabilitado
if(this.options[this.selectedIndex].disabled){
if(this.options.length<=1){
this.selectedIndex = -1;
}else if(this.selectedIndex < this.options.length - 1){
this.selectedIndex++;
}else{
this.selectedIndex--;
}
}
}
if(sels[i].options[sels[i].selectedIndex].disabled){
//se o selecionado atual � desabilitado chamo o onchange
sels[i].onchange();
}
for(var j=0; j < sels[i].options.length; j++){ //colocando o estilo
if(sels[i].options[j].disabled){
sels[i].options[j].style.color = '#CCC';
}
}
}
}
function check()
{
form=document.main_f;
if (form.topic.value=="")
alert ("Vous n\'avez pas rempli le nom du produit!");
else if (form.quantity.value==0 || isNaN(form.quantity.value))
alert ("La quantité est erronée!");
else if (form.price.value==0)
alert ("Le prix est erroné!");
else if (form.text.value=="")
alert ("Le texte est vide!");
else if (form.approve.checked == false)
alert ("Vous devez valider l'authenticité des produits");
else form.submit();
}