/************************************************************/

// JavaScript Scripts

	/********************************************************/
	
	function CreateBookmarkLink(title,url)
	{
	 	//title = "Webpage Title"; 
	  	// Blogger - Replace with <$BlogItemTitle$> 
	  	// MovableType - Replace with <$MTEntryTitle$>
	
	 	//url = "Webpage URL";
	  	// Blogger - Replace with <$BlogItemPermalinkURL$> 
	  	// MovableType - Replace with <$MTEntryPermalink$>
	  	// WordPress - <?php bloginfo('url'); ?>
	
		if (window.sidebar) { // Mozilla Firefox Bookmark
			window.sidebar.addPanel(title, url,"");
		} else if( window.external ) { // IE Favorite
			window.external.AddFavorite( url, title); }
		else if(window.opera && window.print) { // Opera Hotlist
			return true; }
	}

	/* AANVULLING OP VOORGAANDE FUNCTIE OM VERSCHILLENDE 'REGELS' TE TONEN PER OPDRACHT
	if (window.external) {
	  document.write('<a href = 
	     "javascript:CreateBookmarkLink()");">Add to Favorites</a>'); 
	  } else  if (window.sidebar) {
	  document.write('<a href = 
	    "javascript:CreateBookmarkLink()");">Bookmark Page</a>'); 
	 } else if (window.opera && window.print) {	
	   document.write('<a href =
	     "javascript:CreateBookmarkLink()");">Add Bookmark</a>');
	 } 
	*/
	
	function showImage(img_name,img_width,img_height)
	{
		//alert(img_height);
		document.getElementById('mainimg').src = '/listingfiles/270x360/'+img_name;
		//document.getElementById('mainimg').width = img_width;
		//document.getElementById('mainimg').height = img_height;
	}
	
	function preloadImages(images) {
		if (document.images) {
	        var i = 0;
	        var imageArray = new Array();
	        imageArray = images.split(',');
	        var imageObj = new Image();
	        for(i=0; i<=imageArray.length-1; i++) {
	            //document.write('<img src="' + imageArray[i] + '" />');// Write to page (uncomment to check images)
	            imageObj.src=images[i];
	        }
	    }
	}
	

/************************************************************/

// JavaScript Objects

	/********************************************************/

	getObject = function(listing_id,site_identification)
	{
   		this.OnSuccess = function()
   		{
       		document.getElementById('showphonenumber').innerHTML = this.GetResponseText();
  		}
   		this.GetData = function(listing_id,site_identification)
   		{
       		this.InitializeRequest('POST', '/includes/php/ajax_getphonenumber.php?listing_id=' 
			+ listing_id + '&site_identification=' + site_identification);
       		this.Commit(null);
   		}
	}
	getObject.prototype = new ajax();
	thisObject = new getObject();

	/********************************************************/
	
	getLiveResultObject = function(str)
	{
   		this.OnSuccess = function()
   		{
			
			var ResponseHTML = this.GetResponseText();
			if (ResponseHTML){ document.getElementById('livesearch').style.visibility = 'visible'; }
			else { document.getElementById('livesearch').style.visibility = 'hidden'; }
       		document.getElementById('livesearch').innerHTML = ResponseHTML;
  		}
   		this.GetData = function(str)
   		{
   			if (str.length > 2)
   			{
   				this.InitializeRequest('POST', '/includes/php/ajax_livesearch.php?str='	+ str);
       			this.Commit(null);
       		}
       		else {
       			document.getElementById('livesearch').innerHTML = '';
       			document.getElementById('livesearch').style.visibility = 'hidden';
       		}
   		}
	}
	getLiveResultObject.prototype = new ajax();
	thisLiveResultObject = new getLiveResultObject();
	
	/********************************************************/
	
	getMylistObject = function(listing_id,site_identification)
	{
   		this.OnSuccess = function()
   		{
       		document.getElementById('mylist').innerHTML = this.GetResponseText();
  		}
   		this.GetData = function(listing_id,site_identification)
   		{
       		this.InitializeRequest('POST', '/includes/php/ajax_updatepreferencelist.php?listing_id='
			+ listing_id + '&site_identification=' + site_identification + '&portalname_s=' + '&portalname_p=');
       		this.Commit(null);
   		}
	}
	getMylistObject.prototype = new ajax();
	thisMylistObject = new getMylistObject();	
	
