var sitepath = 'http://www.globaldesign.com.ro/'; function make_link(url) { gigel = window.open(); gigel.document.location.href=url.replace("|",".").replace("|",".").replace("|",".").replace("|",".").replace("|",".").replace("|",".").replace("|",".").replace("|","."); } function select_varianta(varianta){ if(varianta_selectata!=varianta){ if(document.getElementById('small_image_'+varianta)) change_image(1,3,document.getElementById('small_image_'+varianta)); if(varianta_selectata!=0){ if(document.getElementById('div_'+varianta_selectata)) document.getElementById('div_'+varianta_selectata).className='small_thumbnail'; } varianta_selectata = varianta; varianta_selectata_text = variante[varianta]; if(document.getElementById('div_'+varianta)) document.getElementById('div_'+varianta).className='small_thumbnail_selected'; } //alert(varianta_selectata_text); } function opacity(id, opacStart, opacEnd, millisec) { //speed for each frame var speed = Math.round(millisec / 100); var timer = 0; //determine the direction for the blending, if start and end are the same nothing happens if(opacStart > opacEnd) { for(i = opacStart; i >= opacEnd; i--) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } else if(opacStart < opacEnd) { for(i = opacStart; i <= opacEnd; i++) { setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); timer++; } } } //change the opacity for different browsers function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function change_image(old_size,new_size,obj){ var oldsrc; oldsrc = obj.src; if (oldsrc.indexOf('no_image')>0){ return false; } else{ newsrc = oldsrc.replace("_"+old_size+".jpg","_"+new_size+".jpg"); document.getElementById("imagine_mare").src = newsrc; } } function preview_image(old_size,new_size,id){ var oldsrc,newsrc; if(id) oldsrc = id.src; else oldsrc = document.getElementById("imagine_mare").src; if (oldsrc.indexOf('no_image')>0){ return false; } else{ newsrc = oldsrc.replace("_"+old_size+".jpg","_"+new_size+".jpg"); window.open(sitepath+'preview.php?img='+newsrc,'zoom','scrollbars=yes,height=100,width=200,status=no,toolbar=no,menubar=no,location=no'); } } function random_change_picture(){ //opacity('main_picture', 100, 0, 200); document.getElementById('main_picture').src='images/poza' + Math.floor(Math.random() * 6 + 1) + '_homepage.jpg'; //opacity('main_picture', 0, 100, 200); setTimeout('random_change_picture()', 7000); }