// JScript source code
function socializeGetTitle() {
	var pageTitle = document.getElementsByTagName("title");
	if (pageTitle.length > 0) {
		return pageTitle[0].innerHTML;
		}
	else {
		return "pcRUSH.com";
		}
	}

function socializeLinks(){
	for( var i = 0; i < arguments.length; i++ ) {
		socializeThis(arguments[i]);
		}
	}
	
function socializeThis(social,track){
	var socializeThisURL = document.location.href.toLowerCase();
	var socializeHost = (("https:" == document.location.protocol) ? "https://" : "http://");
	var socializeDomain = "www.pcrush.com";
	var socializeTitle = socializeGetTitle();
	socializeThisURL = encodeURIComponent(socializeThisURL);
	socializeTitle = encodeURIComponent(socializeTitle);
	track = track || "";
	if (socializeCheck(social) == true){
		//share and bookmarks
		if (social == "myfavs") {
			document.write('<li><a rel="nofollow" '+ track +'href="javascript:addToFavorites(\''+ socializeThisURL + '\', \''+ socializeTitle + '\');" title="Add to Favorites"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/favorites.gif" alt="Add to Favorites" class="socials-hover"></a></li>');
			}			
		else if (social == "delicious") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://del.icio.us/post?url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Delicious"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/delicious.gif" alt="Add to Delicious" class="socials-hover"></a></li>');
			}
		else if (social == "google") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&bkmk='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Google Bookmarks"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/googlebookmark.gif" alt="Add to Google Bookmarks" class="socials-hover"></a></li>');
			}
		else if (social == "faves") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://faves.com/Authoring.aspx?u='+ socializeThisURL +'&t='+ socializeTitle +'" title="Faves It"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/faves.gif" alt="Faves It" class="socials-hover"></a></li>');
			}
		else if (social == "digg") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://digg.com/submit?phase=2&url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Digg This Page"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/digg.gif" alt="Digg This Page" class="socials-hover"></a></li>');
			}
		else if (social == "stumbleupon") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.stumbleupon.com/submit?url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Stumble It"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/su.gif" alt="Stumble It" class="socials-hover"></a></li>');
			}
		else if (social == "facebook") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.facebook.com/share.php?src=bm&u='+ socializeThisURL +'&t='+ socializeTitle +'" title="Add to Facebook"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/facebook.gif" alt="Add to Facebook" class="socials-hover"></a></li>');
			}
		else if (social == "technorati") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://technorati.com/faves?add='+ socializeThisURL +'" title="Add to Technorati"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/technorati.gif" alt="Add to Technorati" class="socials-hover"></a></li>');
			}
		else if (social == "spurl") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.spurl.net/spurl.php?url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Spurl"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/spurl.gif" alt="Add to Spurl" class="socials-hover"></a></li>');
			}
		else if (social == "slashdot") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://slashdot.org/slashdot-it.pl?op=basic&url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Slashdot It"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/slashdot.gif" alt="Slashdot It" class="socials-hover"></a></li>');
			}
		else if (social == "blogmarks") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://blogmarks.net/my/new.php?mini=1&url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Blogmarks"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/blogmarks.gif" alt="Add to Blogmarks" class="socials-hover"></a></li>');
			}
		else if (social == "live") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="https://favorites.live.com/quickadd.aspx?marklet=1&url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Windows Live"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/live.gif" alt="Add to Windows Live" class="socials-hover"></a></li>');
			}
		else if (social == "diigo") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.diigo.com/post?url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Diigo"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/diigo.gif" alt="Add to Diigo" class="socials-hover"></a></li>');
			}
		else if (social == "mrwong") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.mister-wong.com/index.php?action=addurl&bm_url='+ socializeThisURL +'&title='+ socializeTitle +'" title="Add to Mister Wong"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/misterwong.gif" alt="Add to Mister Wong" class="socials-hover"></a></li>');
			}
		else if (social == "yahoo") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u='+ socializeThisURL +'&t='+ socializeTitle +'" title="Add to Yahoo Myweb"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/yahoomyweb.gif" alt="Add to Yahoo Myweb" class="socials-hover"></a></li>');
			}
		else if (social == "reddit") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://reddit.com/submit?url='+ socializeThisURL +'&t='+ socializeTitle +'" title="Add to Reddit"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/reddit.gif" alt="Add to Reddit" class="socials-hover"></a></li>');
			}
		//follow us		
		else if (social == "fbfollow") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.facebook.com/pages/pcRUSHcom/117502587388" title="Become a Fan on Facebook"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/facebook.gif" alt="Become a Fan on Facebook" class="socials-hover"></a></li>');
			}	
		else if (social == "twtfollow") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://twitter.com/pcrush" title="Follow us on Twitter"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/twitter.gif" alt="Follow us on Twitter" class="socials-hover"></a></li>');
			}	
		else if (social == "ytfollow") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.youtube.com/user/pcRUSHtechTV" title="Subscribe to YouTube"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/youtube.png" alt="Subscribe to YouTube" class="socials-hover"></a></li>');
			}	
		else if (social == "lifollow") {
			document.write('<li><a rel="nofollow" '+ track +'target="_blank" href="http://www.linkedin.com/companies/pcrush.com" title="Find us in LinkedIn"><img src="'+socializeHost+socializeDomain+'/images/public_img/public_icon_img/linkedin.gif" alt="Find us in LinkedIn" class="socials-hover"></a></li>');
			}																																																											
		}
	}

// Check an arg exist or not
function socializeCheck(arg) {
    if (typeof(arg) == "undefined" || arg == null || arg == "") {
		return false;
		}
    return true;
	}


function addToFavorites(url, title) {  
	var title = document.title; var url = location.href;  
	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();
		}  
	} 