function bookmarkthis(title,url) {
  if (window.sidebar) { // firefox
     window.sidebar.addPanel(title, url, "");
  } else if (document.all) { // IE
     window.external.AddFavorite(url, title);
  } 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();
  }
}


function openWindows(url,windowObjCaption,width,height,top,left,scrollbars,resizable){
  var windows = window.open(url,windowObjCaption,'width='+width+',height='+height+',top='+top+',left='+left+',scrollbars='+scrollbars+',resizable='+resizable);
  windows.focus();
}

function displayImage( id,imageSrc ) {
  	var selectedImageID = "PRODUCTPIC";
    if ( id == selectedImageID ) return;
    
    selectedImageID = id;
    document.getElementById('PRODUCTPIC').innerHTML = '<img src='+imageSrc+'>';
    //document.getElementById('linkMasterImage').innerHTML = 'Produktbild anzeigen';
	
 		var imageThumbnail = document.getElementById(id);
    if (imageThumbnail != null) {
		imageThumbnail.style.border = '1px solid #999999';
      }
      	document.getElementById(id).style.border = '1px solid #00FFFF';
      
  }
  
  function unMarkThumbnailBox(id){
  	document.getElementById(id).style.border = '0px solid';
  }
  
  function checkDropdownOption(field){
		return field.options[field.selectedIndex].value;
}

/*
 * Bookmark.js
 */
function ShowTitle(text) {
	if (text == '') {
		text = '...';
	} else {
		text='<strong>'+text+'</strong>';
	}
	document.getElementById('bmText').innerHTML=text;
}
function ShowBookmark(site) {
	bmurl=encodeURIComponent(location.href);
	bmtitle=encodeURIComponent(document.title);
	switch(site) {		
		case 'delicious':
			window.open('http://del.icio.us/post?url='+bmurl+'&title='+bmtitle);
			break;
		case 'wong':
			window.open('http://www.mister-wong.de/index.php?action=addurl&bm_url='+bmurl+'&bm_description='+bmtitle);
			break;
		case 'linkarena':	
			window.open('http://linkarena.com/bookmarks/addlink/?url='+bmurl+'&title='+bmtitle+'&desc=&tags=');
			break;
		case 'google': 		
			window.open('http://www.google.com/bookmarks/mark?op=add&hl=de&bkmk='+bmurl+'&title='+bmtitle);
			break;
		case 'webnews': 		
			window.open('http://www.webnews.de/einstellen?url='+bmurl+'&title='+bmtitle);
			break;
		case 'yigg':
			window.open('http://yigg.de/neu?exturl='+bmurl+'&exttitle='+bmtitle);
			break;	
		case 'oneview':
			window.open('http://beta.oneview.de:80/quickadd/neu/addBookmark.jsf?URL='+bmurl+'&title='+bmtitle);			
			break;
		case 'digg': 		
			window.open('http://digg.com/submit?phase=2&url='+bmurl+'&title='+bmtitle);
			break;
	}
}

// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedRadioValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

//Mark all Checkboxes to become checked
checked=false;
function checkedCheckBoxAll(frmProducts) {
  alert('test');
	var cb = document.getElementById('frmProducts');
	 if (checked == false)
          {
           checked = true
          }
        else
          {
          checked = false
          }
	for (var i =0; i < cb.elements.length; i++) 
	{
	 cb.elements[i].checked = checked;
	}
      }


 

